haiway 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. haiway-0.1.0/LICENSE +21 -0
  2. haiway-0.1.0/PKG-INFO +86 -0
  3. haiway-0.1.0/README.md +41 -0
  4. haiway-0.1.0/pyproject.toml +68 -0
  5. haiway-0.1.0/setup.cfg +4 -0
  6. haiway-0.1.0/src/haiway/__init__.py +75 -0
  7. haiway-0.1.0/src/haiway/context/__init__.py +14 -0
  8. haiway-0.1.0/src/haiway/context/access.py +416 -0
  9. haiway-0.1.0/src/haiway/context/dependencies.py +61 -0
  10. haiway-0.1.0/src/haiway/context/metrics.py +329 -0
  11. haiway-0.1.0/src/haiway/context/state.py +115 -0
  12. haiway-0.1.0/src/haiway/context/tasks.py +65 -0
  13. haiway-0.1.0/src/haiway/context/types.py +17 -0
  14. haiway-0.1.0/src/haiway/helpers/__init__.py +13 -0
  15. haiway-0.1.0/src/haiway/helpers/asynchronous.py +226 -0
  16. haiway-0.1.0/src/haiway/helpers/cache.py +326 -0
  17. haiway-0.1.0/src/haiway/helpers/retry.py +210 -0
  18. haiway-0.1.0/src/haiway/helpers/throttling.py +133 -0
  19. haiway-0.1.0/src/haiway/helpers/timeout.py +112 -0
  20. haiway-0.1.0/src/haiway/py.typed +0 -0
  21. haiway-0.1.0/src/haiway/state/__init__.py +8 -0
  22. haiway-0.1.0/src/haiway/state/attributes.py +360 -0
  23. haiway-0.1.0/src/haiway/state/structure.py +254 -0
  24. haiway-0.1.0/src/haiway/state/validation.py +125 -0
  25. haiway-0.1.0/src/haiway/types/__init__.py +11 -0
  26. haiway-0.1.0/src/haiway/types/frozen.py +5 -0
  27. haiway-0.1.0/src/haiway/types/missing.py +91 -0
  28. haiway-0.1.0/src/haiway/utils/__init__.py +23 -0
  29. haiway-0.1.0/src/haiway/utils/always.py +61 -0
  30. haiway-0.1.0/src/haiway/utils/env.py +164 -0
  31. haiway-0.1.0/src/haiway/utils/immutable.py +28 -0
  32. haiway-0.1.0/src/haiway/utils/logs.py +57 -0
  33. haiway-0.1.0/src/haiway/utils/mimic.py +77 -0
  34. haiway-0.1.0/src/haiway/utils/noop.py +24 -0
  35. haiway-0.1.0/src/haiway/utils/queue.py +89 -0
  36. haiway-0.1.0/src/haiway.egg-info/PKG-INFO +86 -0
  37. haiway-0.1.0/src/haiway.egg-info/SOURCES.txt +44 -0
  38. haiway-0.1.0/src/haiway.egg-info/dependency_links.txt +1 -0
  39. haiway-0.1.0/src/haiway.egg-info/requires.txt +8 -0
  40. haiway-0.1.0/src/haiway.egg-info/top_level.txt +1 -0
  41. haiway-0.1.0/tests/test_async_queue.py +110 -0
  42. haiway-0.1.0/tests/test_auto_retry.py +296 -0
  43. haiway-0.1.0/tests/test_cache.py +191 -0
  44. haiway-0.1.0/tests/test_context.py +101 -0
  45. haiway-0.1.0/tests/test_structure.py +115 -0
  46. haiway-0.1.0/tests/test_timeout.py +52 -0
haiway-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Miquido
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
haiway-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.1
2
+ Name: haiway
3
+ Version: 0.1.0
4
+ Summary: Framework for dependency injection and state management within structured concurrency model.
5
+ Maintainer-email: Kacper Kaliński <kacper.kalinski@miquido.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Miquido
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: Homepage, https://miquido.com
28
+ Project-URL: Repository, https://github.com/miquido/haiway.git
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: Programming Language :: Python
32
+ Classifier: Typing :: Typed
33
+ Classifier: Topic :: Software Development
34
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
35
+ Requires-Python: >=3.12
36
+ Description-Content-Type: text/markdown
37
+ License-File: LICENSE
38
+ Provides-Extra: dev
39
+ Requires-Dist: ruff~=0.5.0; extra == "dev"
40
+ Requires-Dist: pyright~=1.1; extra == "dev"
41
+ Requires-Dist: bandit~=1.7; extra == "dev"
42
+ Requires-Dist: pytest~=7.4; extra == "dev"
43
+ Requires-Dist: pytest-cov~=4.1; extra == "dev"
44
+ Requires-Dist: pytest-asyncio~=0.23.0; extra == "dev"
45
+
46
+ # 🚗 haiway 🚕 🚚 🚙
47
+
48
+ haiway is a framework helping to build better project codebase by leveraging concepts of structured concurrency and functional programming.
49
+
50
+ ## 🖥️ Install
51
+
52
+ With pip:
53
+
54
+ ```bash
55
+ pip install haiway
56
+ ```
57
+
58
+ ## 👷 Contributing
59
+
60
+ As an open-source project in a rapidly evolving field, we welcome all contributions. Whether you can add a new feature, enhance our infrastructure, or improve our documentation, your input is valuable to us.
61
+
62
+ We welcome any feedback and suggestions! Feel free to open an issue or pull request.
63
+
64
+ ## ⚖️ License
65
+
66
+ MIT License
67
+
68
+ Copyright (c) 2024 Miquido
69
+
70
+ Permission is hereby granted, free of charge, to any person obtaining a copy
71
+ of this software and associated documentation files (the "Software"), to deal
72
+ in the Software without restriction, including without limitation the rights
73
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74
+ copies of the Software, and to permit persons to whom the Software is
75
+ furnished to do so, subject to the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be included in all
78
+ copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86
+ SOFTWARE.
haiway-0.1.0/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # 🚗 haiway 🚕 🚚 🚙
2
+
3
+ haiway is a framework helping to build better project codebase by leveraging concepts of structured concurrency and functional programming.
4
+
5
+ ## 🖥️ Install
6
+
7
+ With pip:
8
+
9
+ ```bash
10
+ pip install haiway
11
+ ```
12
+
13
+ ## 👷 Contributing
14
+
15
+ As an open-source project in a rapidly evolving field, we welcome all contributions. Whether you can add a new feature, enhance our infrastructure, or improve our documentation, your input is valuable to us.
16
+
17
+ We welcome any feedback and suggestions! Feel free to open an issue or pull request.
18
+
19
+ ## ⚖️ License
20
+
21
+ MIT License
22
+
23
+ Copyright (c) 2024 Miquido
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a copy
26
+ of this software and associated documentation files (the "Software"), to deal
27
+ in the Software without restriction, including without limitation the rights
28
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
+ copies of the Software, and to permit persons to whom the Software is
30
+ furnished to do so, subject to the following conditions:
31
+
32
+ The above copyright notice and this permission notice shall be included in all
33
+ copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
+ SOFTWARE.
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "haiway"
7
+ description = "Framework for dependency injection and state management within structured concurrency model."
8
+ version = "0.1.0"
9
+ readme = "README.md"
10
+ maintainers = [
11
+ { name = "Kacper Kaliński", email = "kacper.kalinski@miquido.com" },
12
+ ]
13
+ requires-python = ">=3.12"
14
+ classifiers = [
15
+ "License :: OSI Approved :: MIT License",
16
+ "Intended Audience :: Developers",
17
+ "Programming Language :: Python",
18
+ "Typing :: Typed",
19
+ "Topic :: Software Development",
20
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
21
+ ]
22
+ license = { file = "LICENSE" }
23
+ dependencies = []
24
+
25
+ [project.urls]
26
+ Homepage = "https://miquido.com"
27
+ Repository = "https://github.com/miquido/haiway.git"
28
+
29
+ [project.optional-dependencies]
30
+ dev = [
31
+ "ruff~=0.5.0",
32
+ "pyright~=1.1",
33
+ "bandit~=1.7",
34
+ "pytest~=7.4",
35
+ "pytest-cov~=4.1",
36
+ "pytest-asyncio~=0.23.0",
37
+ ]
38
+
39
+ [tool.ruff]
40
+ target-version = "py312"
41
+ line-length = 100
42
+ extend-exclude = [".venv", ".git", ".cache"]
43
+ lint.select = ["E", "F", "A", "I", "B", "PL", "W", "C", "RUF", "UP"]
44
+ lint.ignore = []
45
+
46
+ [tool.ruff.lint.per-file-ignores]
47
+ "__init__.py" = ["F401", "E402"]
48
+ "./tests/*.py" = ["PLR2004"]
49
+
50
+ [tool.pyright]
51
+ pythonVersion = "3.12"
52
+ venvPath = "."
53
+ venv = ".venv"
54
+ include = ["./src"]
55
+ exclude = ["**/node_modules", "**/__pycache__"]
56
+ ignore = []
57
+ stubPath = "./stubs"
58
+ reportMissingImports = true
59
+ reportMissingTypeStubs = true
60
+ typeCheckingMode = "strict"
61
+ userFileIndexingLimit = -1
62
+ useLibraryCodeForTypes = true
63
+
64
+ [tool.setuptools]
65
+ include-package-data = true
66
+
67
+ [tool.setuptools.packages.find]
68
+ where = ["src"]
haiway-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,75 @@
1
+ from haiway.context import (
2
+ Dependencies,
3
+ Dependency,
4
+ MissingContext,
5
+ MissingDependency,
6
+ MissingState,
7
+ ScopeMetrics,
8
+ ctx,
9
+ )
10
+ from haiway.helpers import (
11
+ asynchronous,
12
+ auto_retry,
13
+ cached,
14
+ throttle,
15
+ with_timeout,
16
+ )
17
+ from haiway.state import Structure
18
+ from haiway.types import (
19
+ MISSING,
20
+ Missing,
21
+ frozenlist,
22
+ is_missing,
23
+ not_missing,
24
+ when_missing,
25
+ )
26
+ from haiway.utils import (
27
+ AsyncQueue,
28
+ always,
29
+ async_always,
30
+ async_noop,
31
+ freeze,
32
+ getenv_bool,
33
+ getenv_float,
34
+ getenv_int,
35
+ getenv_str,
36
+ load_env,
37
+ mimic_function,
38
+ noop,
39
+ setup_logging,
40
+ )
41
+
42
+ __all__ = [
43
+ "always",
44
+ "async_always",
45
+ "async_noop",
46
+ "asynchronous",
47
+ "AsyncQueue",
48
+ "auto_retry",
49
+ "cached",
50
+ "ctx",
51
+ "Dependencies",
52
+ "Dependency",
53
+ "freeze",
54
+ "frozenlist",
55
+ "getenv_bool",
56
+ "getenv_float",
57
+ "getenv_int",
58
+ "getenv_str",
59
+ "is_missing",
60
+ "load_env",
61
+ "mimic_function",
62
+ "Missing",
63
+ "MISSING",
64
+ "MissingContext",
65
+ "MissingDependency",
66
+ "MissingState",
67
+ "noop",
68
+ "not_missing",
69
+ "ScopeMetrics",
70
+ "setup_logging",
71
+ "Structure",
72
+ "throttle",
73
+ "when_missing",
74
+ "with_timeout",
75
+ ]
@@ -0,0 +1,14 @@
1
+ from haiway.context.access import ctx
2
+ from haiway.context.dependencies import Dependencies, Dependency
3
+ from haiway.context.metrics import ScopeMetrics
4
+ from haiway.context.types import MissingContext, MissingDependency, MissingState
5
+
6
+ __all__ = [
7
+ "ctx",
8
+ "Dependencies",
9
+ "Dependency",
10
+ "MissingContext",
11
+ "MissingDependency",
12
+ "MissingState",
13
+ "ScopeMetrics",
14
+ ]