engin 0.2.0__tar.gz → 0.2.1__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 (118) hide show
  1. {engin-0.2.0 → engin-0.2.1}/PKG-INFO +11 -12
  2. {engin-0.2.0 → engin-0.2.1}/README.md +2 -2
  3. {engin-0.2.0 → engin-0.2.1}/pyproject.toml +3 -3
  4. {engin-0.2.0 → engin-0.2.1}/src/engin/_block.py +4 -0
  5. engin-0.2.0/.github/workflows/benchmark.yaml +0 -41
  6. engin-0.2.0/.github/workflows/check.yaml +0 -51
  7. engin-0.2.0/.github/workflows/publish.yaml +0 -34
  8. engin-0.2.0/.gitignore +0 -167
  9. engin-0.2.0/.readthedocs.yaml +0 -25
  10. engin-0.2.0/CHANGELOG.md +0 -283
  11. engin-0.2.0/LICENSE +0 -21
  12. engin-0.2.0/docs/cli.md +0 -144
  13. engin-0.2.0/docs/concepts/blocks.md +0 -83
  14. engin-0.2.0/docs/concepts/engin.md +0 -62
  15. engin-0.2.0/docs/concepts/invocations.md +0 -130
  16. engin-0.2.0/docs/concepts/lifecycle.md +0 -103
  17. engin-0.2.0/docs/concepts/providers.md +0 -273
  18. engin-0.2.0/docs/concepts/supervisor.md +0 -76
  19. engin-0.2.0/docs/engin-graph-output.png +0 -0
  20. engin-0.2.0/docs/index.md +0 -98
  21. engin-0.2.0/docs/integrations/fastapi-graph.png +0 -0
  22. engin-0.2.0/docs/integrations/fastapi.md +0 -176
  23. engin-0.2.0/docs/js/readthedocs.js +0 -7
  24. engin-0.2.0/docs/overrides/main.html +0 -6
  25. engin-0.2.0/docs/reference.md +0 -12
  26. engin-0.2.0/docs/tutorial/1_empty_application.md +0 -37
  27. engin-0.2.0/docs/tutorial/2_create_a_publisher.md +0 -101
  28. engin-0.2.0/docs/tutorial/3_run_the_application.md +0 -61
  29. engin-0.2.0/docs/tutorial/4_refactor_valkey_client.md +0 -100
  30. engin-0.2.0/docs/tutorial/index.md +0 -8
  31. engin-0.2.0/examples/asgi/__init__.py +0 -0
  32. engin-0.2.0/examples/asgi/app.py +0 -34
  33. engin-0.2.0/examples/asgi/common/__init__.py +0 -0
  34. engin-0.2.0/examples/asgi/common/db/__init__.py +0 -0
  35. engin-0.2.0/examples/asgi/common/db/adapaters/__init__.py +0 -0
  36. engin-0.2.0/examples/asgi/common/db/adapaters/memory.py +0 -17
  37. engin-0.2.0/examples/asgi/common/db/block.py +0 -9
  38. engin-0.2.0/examples/asgi/common/db/ports.py +0 -13
  39. engin-0.2.0/examples/asgi/common/starlette/__init__.py +0 -0
  40. engin-0.2.0/examples/asgi/common/starlette/endpoint.py +0 -46
  41. engin-0.2.0/examples/asgi/features/__init__.py +0 -0
  42. engin-0.2.0/examples/asgi/features/cats/__init__.py +0 -0
  43. engin-0.2.0/examples/asgi/features/cats/api/__init__.py +0 -0
  44. engin-0.2.0/examples/asgi/features/cats/api/get.py +0 -32
  45. engin-0.2.0/examples/asgi/features/cats/api/post.py +0 -28
  46. engin-0.2.0/examples/asgi/features/cats/block.py +0 -45
  47. engin-0.2.0/examples/asgi/features/cats/domain.py +0 -17
  48. engin-0.2.0/examples/asgi/main.py +0 -19
  49. engin-0.2.0/examples/fastapi/__init__.py +0 -0
  50. engin-0.2.0/examples/fastapi/app.py +0 -29
  51. engin-0.2.0/examples/fastapi/main.py +0 -16
  52. engin-0.2.0/examples/fastapi/routes/__init__.py +0 -0
  53. engin-0.2.0/examples/fastapi/routes/cats/__init__.py +0 -0
  54. engin-0.2.0/examples/fastapi/routes/cats/adapters/__init__.py +0 -0
  55. engin-0.2.0/examples/fastapi/routes/cats/adapters/repository.py +0 -18
  56. engin-0.2.0/examples/fastapi/routes/cats/api.py +0 -42
  57. engin-0.2.0/examples/fastapi/routes/cats/block.py +0 -14
  58. engin-0.2.0/examples/fastapi/routes/cats/domain.py +0 -18
  59. engin-0.2.0/examples/fastapi/routes/cats/ports.py +0 -14
  60. engin-0.2.0/examples/simple/__init__.py +0 -0
  61. engin-0.2.0/examples/simple/main.py +0 -23
  62. engin-0.2.0/examples/tutorial/__init__.py +0 -0
  63. engin-0.2.0/examples/tutorial/app.py +0 -18
  64. engin-0.2.0/examples/tutorial/publisher.py +0 -28
  65. engin-0.2.0/examples/tutorial/valkey_client.py +0 -23
  66. engin-0.2.0/mkdocs.yaml +0 -94
  67. engin-0.2.0/src/engin/extensions/__init__.py +0 -0
  68. engin-0.2.0/tests/__init__.py +0 -0
  69. engin-0.2.0/tests/acceptance/__init__.py +0 -0
  70. engin-0.2.0/tests/acceptance/test_engin_signal_handling.py +0 -39
  71. engin-0.2.0/tests/acceptance/test_error_in_invocation.py +0 -28
  72. engin-0.2.0/tests/acceptance/test_error_in_lifecycle_shutdown.py +0 -60
  73. engin-0.2.0/tests/acceptance/test_error_in_lifecycle_startup.py +0 -69
  74. engin-0.2.0/tests/acceptance/test_error_in_provider.py +0 -35
  75. engin-0.2.0/tests/acceptance/test_error_in_supervisor_task.py +0 -29
  76. engin-0.2.0/tests/acceptance/test_fastapi.py +0 -137
  77. engin-0.2.0/tests/benchmarks/__init__.py +0 -0
  78. engin-0.2.0/tests/benchmarks/conftest.py +0 -21
  79. engin-0.2.0/tests/benchmarks/test_benchmarks.py +0 -126
  80. engin-0.2.0/tests/cli/__init__.py +0 -0
  81. engin-0.2.0/tests/cli/test_check.py +0 -94
  82. engin-0.2.0/tests/cli/test_get_engin_instance.py +0 -111
  83. engin-0.2.0/tests/cli/test_graph.py +0 -83
  84. engin-0.2.0/tests/cli/test_inspect.py +0 -16
  85. engin-0.2.0/tests/conftest.py +0 -0
  86. engin-0.2.0/tests/deps.py +0 -44
  87. engin-0.2.0/tests/extensions/__init__.py +0 -0
  88. engin-0.2.0/tests/extensions/test_asgi.py +0 -281
  89. engin-0.2.0/tests/test_assembler.py +0 -220
  90. engin-0.2.0/tests/test_block.py +0 -54
  91. engin-0.2.0/tests/test_dependencies.py +0 -165
  92. engin-0.2.0/tests/test_engin.py +0 -159
  93. engin-0.2.0/tests/test_graph.py +0 -33
  94. engin-0.2.0/tests/test_lifecycle.py +0 -82
  95. engin-0.2.0/tests/test_supervisor.py +0 -136
  96. engin-0.2.0/tests/test_type_id.py +0 -81
  97. engin-0.2.0/uv.lock +0 -1376
  98. {engin-0.2.0 → engin-0.2.1}/src/engin/__init__.py +0 -0
  99. {engin-0.2.0 → engin-0.2.1}/src/engin/_assembler.py +0 -0
  100. {engin-0.2.0 → engin-0.2.1}/src/engin/_cli/__init__.py +0 -0
  101. {engin-0.2.0 → engin-0.2.1}/src/engin/_cli/_check.py +0 -0
  102. {engin-0.2.0 → engin-0.2.1}/src/engin/_cli/_common.py +0 -0
  103. {engin-0.2.0 → engin-0.2.1}/src/engin/_cli/_graph.html +0 -0
  104. {engin-0.2.0 → engin-0.2.1}/src/engin/_cli/_graph.py +0 -0
  105. {engin-0.2.0 → engin-0.2.1}/src/engin/_cli/_inspect.py +0 -0
  106. {engin-0.2.0 → engin-0.2.1}/src/engin/_dependency.py +0 -0
  107. {engin-0.2.0 → engin-0.2.1}/src/engin/_engin.py +0 -0
  108. {engin-0.2.0 → engin-0.2.1}/src/engin/_graph.py +0 -0
  109. {engin-0.2.0 → engin-0.2.1}/src/engin/_introspect.py +0 -0
  110. {engin-0.2.0 → engin-0.2.1}/src/engin/_lifecycle.py +0 -0
  111. {engin-0.2.0 → engin-0.2.1}/src/engin/_option.py +0 -0
  112. {engin-0.2.0 → engin-0.2.1}/src/engin/_supervisor.py +0 -0
  113. {engin-0.2.0 → engin-0.2.1}/src/engin/_type_utils.py +0 -0
  114. {engin-0.2.0 → engin-0.2.1}/src/engin/exceptions.py +0 -0
  115. {engin-0.2.0/examples → engin-0.2.1/src/engin/extensions}/__init__.py +0 -0
  116. {engin-0.2.0 → engin-0.2.1}/src/engin/extensions/asgi.py +0 -0
  117. {engin-0.2.0 → engin-0.2.1}/src/engin/extensions/fastapi.py +0 -0
  118. {engin-0.2.0 → engin-0.2.1}/src/engin/py.typed +0 -0
@@ -1,21 +1,20 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: engin
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: A dependency-injection powered application framework
5
- Project-URL: Homepage, https://github.com/invokermain/engin
6
- Project-URL: Documentation, https://engin.readthedocs.io/en/latest/
7
- Project-URL: Repository, https://github.com/invokermain/engin.git
8
- Project-URL: Changelog, https://github.com/invokermain/engin/blob/main/CHANGELOG.md
5
+ Keywords: Dependency Injection,Application Framework
9
6
  License-Expression: MIT
10
- License-File: LICENSE
11
- Keywords: Application Framework,Dependency Injection
12
- Requires-Python: >=3.10
13
7
  Requires-Dist: anyio>=4
14
8
  Requires-Dist: exceptiongroup>=1
15
9
  Requires-Dist: typing-extensions>=4
10
+ Requires-Dist: typer>=0.15 ; extra == 'cli'
11
+ Requires-Dist: tomli>=2.0 ; python_full_version < '3.11' and extra == 'cli'
12
+ Requires-Python: >=3.10
13
+ Project-URL: Changelog, https://github.com/invokermain/engin/blob/main/CHANGELOG.md
14
+ Project-URL: Documentation, https://engin.readthedocs.io/en/latest/
15
+ Project-URL: Homepage, https://github.com/invokermain/engin
16
+ Project-URL: Repository, https://github.com/invokermain/engin.git
16
17
  Provides-Extra: cli
17
- Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'cli'
18
- Requires-Dist: typer>=0.15; extra == 'cli'
19
18
  Description-Content-Type: text/markdown
20
19
 
21
20
  # Engin 🏎️
@@ -30,8 +29,8 @@ Description-Content-Type: text/markdown
30
29
 
31
30
  ---
32
31
 
33
- Engin is a lightweight application framework powered by dependency injection, it helps
34
- you build and maintain large monoliths and many microservices.
32
+ Engin is a lightweight application framework powered by dependency injection. It helps
33
+ you build and maintain everything from large monoliths to hundreds of microservices.
35
34
 
36
35
 
37
36
  ## Features
@@ -10,8 +10,8 @@
10
10
 
11
11
  ---
12
12
 
13
- Engin is a lightweight application framework powered by dependency injection, it helps
14
- you build and maintain large monoliths and many microservices.
13
+ Engin is a lightweight application framework powered by dependency injection. It helps
14
+ you build and maintain everything from large monoliths to hundreds of microservices.
15
15
 
16
16
 
17
17
  ## Features
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "engin"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "A dependency-injection powered application framework"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -56,8 +56,8 @@ docs = [
56
56
  default-groups = ["dev", "docs"]
57
57
 
58
58
  [build-system]
59
- requires = ["hatchling"]
60
- build-backend = "hatchling.build"
59
+ requires = ["uv_build"]
60
+ build-backend = "uv_build"
61
61
 
62
62
 
63
63
  [tool.ruff]
@@ -10,6 +10,8 @@ from engin.exceptions import InvalidBlockError
10
10
  if TYPE_CHECKING:
11
11
  from engin._engin import Engin
12
12
 
13
+ _BUILTIN_CLASS_FUNCTIONS = ("__annotate_func__",)
14
+
13
15
 
14
16
  def provide(
15
17
  func_: Func | None = None, *, scope: str | None = None, override: bool = False
@@ -84,6 +86,8 @@ class Block:
84
86
  @classmethod
85
87
  def _method_options(cls) -> Iterable[Provide | Invoke]:
86
88
  for name, method in inspect.getmembers(cls, inspect.isfunction):
89
+ if name in _BUILTIN_CLASS_FUNCTIONS:
90
+ continue
87
91
  if option := getattr(method, "_opt", None):
88
92
  if not isinstance(option, Provide | Invoke):
89
93
  raise InvalidBlockError(
@@ -1,41 +0,0 @@
1
- name: Benchmark Main
2
-
3
- on:
4
- push:
5
-
6
- env:
7
- UV_FROZEN: "1"
8
-
9
- jobs:
10
- benchmark-main:
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - uses: actions/checkout@v4
15
-
16
- - name: Install uv
17
- uses: astral-sh/setup-uv@v5
18
- with:
19
- enable-cache: true
20
- cache-dependency-glob: "uv.lock"
21
-
22
- - name: Set up Python
23
- uses: actions/setup-python@v5
24
- with:
25
- python-version-file: "pyproject.toml"
26
-
27
- - name: Install the project
28
- run: uv sync --dev
29
-
30
- - name: Run benchmark
31
- run: |
32
- uv run pytest tests --benchmark-only --benchmark-json bench.json
33
-
34
- - name: Store benchmark result
35
- uses: benchmark-action/github-action-benchmark@v1
36
- if: contains('refs/heads/main', github.ref)
37
- with:
38
- tool: 'pytest'
39
- output-file-path: bench.json
40
- github-token: ${{ secrets.PAT }}
41
- auto-push: true
@@ -1,51 +0,0 @@
1
- name: Check
2
-
3
- on:
4
- push:
5
-
6
- env:
7
- UV_FROZEN: "1"
8
-
9
- jobs:
10
- check:
11
- name: python
12
-
13
- strategy:
14
- matrix:
15
- os: [ubuntu-latest, windows-latest, macos-latest]
16
- python-version: ["3.10", "3.11", "3.12", "3.13"]
17
-
18
- runs-on: ${{ matrix.os }}
19
-
20
- permissions:
21
- id-token: write
22
-
23
- steps:
24
- - uses: actions/checkout@v4
25
-
26
- - name: Install uv
27
- uses: astral-sh/setup-uv@v5
28
- with:
29
- enable-cache: true
30
- cache-dependency-glob: "uv.lock"
31
-
32
- - name: Set up Python
33
- uses: actions/setup-python@v5
34
- with:
35
- python-version: ${{ matrix.python-version }}
36
-
37
- - name: Install the project
38
- run: uv sync --all-extras --dev
39
-
40
- - name: Quality
41
- run: uv run poe check
42
-
43
- - name: Test
44
- run: uv run poe ci-test
45
-
46
- - name: Upload coverage reports to Codecov
47
- uses: codecov/codecov-action@v5
48
- with:
49
- token: ${{ secrets.CODECOV_TOKEN }}
50
- flags: ${{ matrix.os }},py${{ matrix.python-version }}
51
- name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
@@ -1,34 +0,0 @@
1
- name: Publish
2
-
3
- on:
4
- workflow_dispatch:
5
- release:
6
- types: [created]
7
-
8
- jobs:
9
- publish-to-pypi:
10
- name: python
11
- runs-on: ubuntu-latest
12
-
13
- permissions:
14
- id-token: write
15
-
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - name: Install uv
20
- uses: astral-sh/setup-uv@v5
21
- with:
22
- enable-cache: true
23
- cache-dependency-glob: "uv.lock"
24
-
25
- - name: Set up Python
26
- uses: actions/setup-python@v5
27
- with:
28
- python-version-file: "pyproject.toml"
29
-
30
- - name: Build the Project
31
- run: uv build
32
-
33
- - name: Publish
34
- run: uv publish
engin-0.2.0/.gitignore DELETED
@@ -1,167 +0,0 @@
1
- # Byte-compiled / optimized / DLL files
2
- __pycache__/
3
- *.py[cod]
4
- *$py.class
5
-
6
- # C extensions
7
- *.so
8
-
9
- # Distribution / packaging
10
- .Python
11
- build/
12
- develop-eggs/
13
- dist/
14
- downloads/
15
- eggs/
16
- .eggs/
17
- lib/
18
- lib64/
19
- parts/
20
- sdist/
21
- var/
22
- wheels/
23
- share/python-wheels/
24
- *.egg-info/
25
- .installed.cfg
26
- *.egg
27
- MANIFEST
28
-
29
- # PyInstaller
30
- # Usually these files are written by a python script from a template
31
- # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
- *.manifest
33
- *.spec
34
-
35
- # Installer logs
36
- pip-log.txt
37
- pip-delete-this-directory.txt
38
-
39
- # Unit test / coverage reports
40
- htmlcov/
41
- .tox/
42
- .nox/
43
- .coverage
44
- .coverage.*
45
- .cache
46
- nosetests.xml
47
- coverage.xml
48
- *.cover
49
- *.py,cover
50
- .hypothesis/
51
- .pytest_cache/
52
- cover/
53
-
54
- # Translations
55
- *.mo
56
- *.pot
57
-
58
- # Django stuff:
59
- *.log
60
- local_settings.py
61
- db.sqlite3
62
- db.sqlite3-journal
63
-
64
- # Flask stuff:
65
- instance/
66
- .webassets-cache
67
-
68
- # Scrapy stuff:
69
- .scrapy
70
-
71
- # Sphinx documentation
72
- docs/_build/
73
-
74
- # PyBuilder
75
- .pybuilder/
76
- target/
77
-
78
- # Jupyter Notebook
79
- .ipynb_checkpoints
80
-
81
- # IPython
82
- profile_default/
83
- ipython_config.py
84
-
85
- # pyenv
86
- # For a library or package, you might want to ignore these files since the code is
87
- # intended to run in multiple environments; otherwise, check them in:
88
- # .python-version
89
-
90
- # pipenv
91
- # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
- # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
- # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
- # install all needed dependencies.
95
- #Pipfile.lock
96
-
97
- # poetry
98
- # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
- # This is especially recommended for binary packages to ensure reproducibility, and is more
100
- # commonly ignored for libraries.
101
- # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
- #poetry.lock
103
-
104
- # pdm
105
- # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
- #pdm.lock
107
- # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
- # in version control.
109
- # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
- .pdm.toml
111
- .pdm-python
112
- .pdm-build/
113
-
114
- # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
- __pypackages__/
116
-
117
- # Celery stuff
118
- celerybeat-schedule
119
- celerybeat.pid
120
-
121
- # SageMath parsed files
122
- *.sage.py
123
-
124
- # Environments
125
- .env
126
- .venv
127
- env/
128
- venv/
129
- ENV/
130
- env.bak/
131
- venv.bak/
132
-
133
- # Spyder project settings
134
- .spyderproject
135
- .spyproject
136
-
137
- # Rope project settings
138
- .ropeproject
139
-
140
- # mkdocs documentation
141
- /site
142
-
143
- # mypy
144
- .mypy_cache/
145
- .dmypy.json
146
- dmypy.json
147
-
148
- # Pyre type checker
149
- .pyre/
150
-
151
- # pytype static type analyzer
152
- .pytype/
153
-
154
- # Cython debug symbols
155
- cython_debug/
156
-
157
- # Python local version specifier
158
- .python-version
159
-
160
- # PyCharm
161
- # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
162
- # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
163
- # and can be added to the global gitignore or merged into this file. For a more nuclear
164
- # option (not recommended) you can uncomment the following to ignore the entire idea folder.
165
- .idea/
166
-
167
- scrap/**
@@ -1,25 +0,0 @@
1
- # Read the Docs configuration file
2
- # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
-
4
- # Required
5
- version: 2
6
-
7
- # Set the OS, Python version, and other tools you might need
8
- build:
9
- os: ubuntu-24.04
10
- tools:
11
- python: "3.13"
12
- jobs:
13
- create_environment:
14
- - asdf plugin add uv
15
- - asdf install uv latest
16
- - asdf global uv latest
17
- - uv venv
18
- install:
19
- - uv sync --group docs
20
- build:
21
- html:
22
- - NO_COLOR=1 uv run mkdocs build -f mkdocs.yaml --strict --site-dir $READTHEDOCS_OUTPUT/html
23
-
24
- mkdocs:
25
- configuration: mkdocs.yaml
engin-0.2.0/CHANGELOG.md DELETED
@@ -1,283 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [0.2.0] - 2025-09-15
9
-
10
- ### Added
11
-
12
- - `Supervisor` now has a shutdown hook option for supervised tasks.
13
-
14
- ### Changed
15
-
16
- - `Provide` now raises a helpful error message when it is called with a static value
17
- suggesting to use `Supply` instead.
18
- - Tests are now ran against all support Python versions and operating systems.
19
- - Improved signal handling code for Windows OS and added handler for SIGBREAK.
20
-
21
- ### Fixed
22
-
23
- - Replaced Python 3.10 unsupported `typing` imports with imports from `typing_extensions`.
24
-
25
-
26
- ## [0.1.0] - 2025-08-16
27
-
28
- ### Added
29
-
30
- - `Supervisor` class which can safely supervise long running tasks.
31
- - A new cli option `engin check` that validates whether you have any missing providers.
32
- - Support for specifying `default-instance` in your `pyproject.toml` under `[tool.engin]`
33
- which is used as a default value for the `app` parameter when using the cli.
34
- - A new exception class: `TypeNotProvidedError`.
35
-
36
- ### Changed
37
-
38
- - If a Provider is missing during Assembly, the Assembler now raises `TypeNotProvidedError`
39
- instead of a `LookupError`.
40
- - `engin graph` has improved visualisations and options.
41
- - `engin check` does not list all available providers anymore.
42
-
43
-
44
- ## [0.0.20] - 2025-06-18
45
-
46
- ### Changed
47
-
48
- - Improved string representation of Provide & Supply to make error messages more helpful.
49
-
50
- ### Fixed
51
-
52
- - Engin now correctly supports postponed evaluation of annotations, e.g. `x: "MyType"` in
53
- a factory function.
54
-
55
-
56
- ## [0.0.19] - 2025-04-27
57
-
58
- ### Added
59
-
60
- - A new exception: `InvalidBlockError`.
61
-
62
- ### Changed
63
-
64
- - Improved performance of Provide & Assembler by a factor of >2x (in certain scenarios).
65
- - Renamed the `ext` subpackage to `extensions`.
66
- - Errors are now imported from `engin.exceptions.*` instead of `engin.*`
67
- - Blocks will now raise an `InvalidBlockError` if the block has methods which are not
68
- decorated with `@provide` & `@invoke`.
69
-
70
- ### Fixed
71
-
72
- - `Assembler.add` incorrect cache invalidation logic.
73
-
74
-
75
- ## [0.0.18] - 2025-04-25
76
-
77
- ### Added
78
-
79
- - A new cli option `engin inspect` that can be used to inspect providers, e.g.
80
- `engin inspect examples.simple.main:engin --module httpx`
81
-
82
-
83
- ## [0.0.17] - 2025-04-20
84
-
85
- ### Added
86
-
87
- - `Provide` now has the `as_type` parameter that `Supply` had previously.
88
-
89
- ### Changed
90
-
91
- - Renamed `parameter_types` property on dependencies to `parameter_type_ids` to be more
92
- explicit.
93
-
94
-
95
- ## [0.0.16] - 2025-04-16
96
-
97
- ### Added
98
-
99
- - Preliminary support for scoped providers. Scoped providers are only accessible when
100
- the assembler is in the matching scope, and the built output is only cached until the
101
- assembler leaves the matching scope. This can be used for example to have request scoped
102
- providers in a Web Server.
103
-
104
- ### Changed
105
-
106
- - Minor improvements to the work-in-progress dependency grapher.
107
-
108
-
109
- ## [0.0.15] - 2025-03-25
110
-
111
- ### Changed
112
-
113
- - `Provide` & `Supply` will now raise an error if overriding an existing provider from the
114
- same package. This is to prevent accidental overrides. Users can explicitly allow
115
- overrides by specifying the `override` parameter when defining the provider
116
- `Provide(..., override=True)` or `@provide(override=True)`.
117
- - Lifecycle startup tasks will now timeout after 15 seconds and raise an error.
118
- - Assembler's `get` method has been renamed to `build`.
119
- - Supply's `type_hint` parameter has been renamed to `as_type`.
120
-
121
- ### Fixed
122
-
123
- - `Assembler` would occasionally fail to call all multiproviders due to inconsistent
124
- ordering.
125
-
126
-
127
- ## [0.0.14] - 2025-03-23
128
-
129
- ### Added
130
-
131
- - `LifecycleHook` class to help build simple lifecycles with a start and stop call.
132
-
133
- ### Changed
134
-
135
- - `engin-graph` has been replaced by `engin graph`.
136
- - Engin now uses `typer` for an improved cli experience. Note the package now has an extra `cli` which must be installed to use the cli.
137
- - `Assembler.add(...)` does not error when adding already registered providers.
138
- - Use a more performant algorithm for inspecting frame stack.
139
-
140
- ### Fixed
141
-
142
- - `ASGIEngin` now properly surfaces startup errors.
143
- - `Engin.run()` doing a double shutdown.
144
-
145
-
146
- ## [0.0.13] - 2025-03-22
147
-
148
- ### Changed
149
-
150
- - `Provide` now supports union types.
151
-
152
-
153
- ## [0.0.12] - 2025-03-03
154
-
155
- ### Added
156
-
157
- - `Assembler` has a new method `add(provider: Provide) -> None` which allows adding a
158
- provider to the Assembler post initialisation.
159
-
160
- ### Changed
161
-
162
- - `Provide` now raises a `ValueError` if the factory function is circular, i.e. one of its
163
- parameters is the same as its return type as the behaviour of this is undefined.
164
- - The ASGI utility method `engin_to_lifespan` has been improved so that it works "out of
165
- the box" for more use cases now.
166
-
167
-
168
- ## [0.0.11] - 2025-03-02
169
-
170
- ### Added
171
-
172
- - Dependency types now have two new attributes `source_module` & `source_package`.
173
-
174
- ### Changed
175
-
176
- - `engin-graph` now highlights external dependencies.
177
-
178
-
179
- ## [0.0.10] - 2025-02-27
180
-
181
- ### Added
182
-
183
- - A utility function for ASGI extension `engin_to_lifespan` enabling users to easily
184
- integrate Engin into an existing ASGI application.
185
- - Further documentation work, including a FastAPI guide.
186
-
187
- ### Fixed
188
-
189
- - The warning for missing multiproviders is only logged once for each given type now.
190
-
191
-
192
- ## [0.0.9] - 2025-02-22
193
-
194
- ### Added
195
-
196
- - Dependency class now has a new attribute: `func_name`.
197
-
198
- ### Changed
199
-
200
- - Improved `engin-graph` output.
201
- - The `module` attribute of dependencies has been renamed to `origin`
202
-
203
- ### Fixed
204
-
205
- - Options provided under the `options` on a Block now have the `block_name` set.
206
-
207
-
208
- ## [0.0.8] - 2025-02-22
209
-
210
- ### Added
211
-
212
- - A package script, `engin-graph` for visualising the dependency graph.
213
-
214
-
215
- ## [0.0.7] - 2025-02-20
216
-
217
- ### Changed
218
-
219
- - TypeId retains Annotations allowing them to be used to discriminate otherwise identical
220
- types.
221
-
222
-
223
- ## [0.0.6] - 2025-02-19
224
-
225
- ### Fixed
226
-
227
- - Engin now respects intended multiproviders behaviour instead of treating them as normal
228
- providers and overwriting existing multiproviders for that type.
229
- - `Engin.shutdown()` does not block if shutdown is called before startup, or after aborted
230
- startup.
231
-
232
-
233
- ## [0.0.5] - 2025-01-29
234
-
235
- ### Added
236
-
237
- - Docstrings for every public class, method and function.
238
-
239
- ### Changed
240
-
241
- - AssemblyError has been renamed to ProviderError.
242
- - Lifecycle now supports synchronous Context Managers.
243
-
244
-
245
- ## [0.0.4] - 2025-01-27
246
-
247
- ### Changed
248
-
249
- - Invocations, startups tasks and shutdown tasks are now all run sequentially.
250
- - Improved error handling, if an Invocation errors, or a Lifecycle startup tasks errors
251
- then the Engin will exit. Whilst errors in shutdown tasks are logged and ignored.
252
- - Improved error messaging when Invocations or Lifecycle tasks error.
253
- - Removed non-public methods from the Lifecycle class, and renamed `register_context` to
254
- `append`.
255
-
256
-
257
- ## [0.0.3] - 2025-01-15
258
-
259
- ### Added
260
-
261
- - Blocks can now provide options via the `options` class variable. This allows packaged
262
- Blocks to easily expose Providers and Invocations as normal functions whilst allowing
263
- them to be part of a Block as well. This makes usage of the Block optional which makes
264
- it more flexible for end users.
265
- - Added missing type hints and enabled mypy strict mode.
266
-
267
- ### Fixed
268
-
269
- - Engin now performs Lifecycle shutdown.
270
-
271
-
272
- ## [0.0.2] - 2025-01-10
273
-
274
- ### Added
275
-
276
- - The `ext` sub-package is now explicitly exported in the package `__init__.py`
277
-
278
-
279
- ## [0.0.1] - 2024-12-12
280
-
281
- ### Added
282
-
283
- - Initial release