anydi 0.48.0__tar.gz → 0.48.2__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 (31) hide show
  1. {anydi-0.48.0 → anydi-0.48.2}/PKG-INFO +2 -2
  2. {anydi-0.48.0 → anydi-0.48.2}/anydi/_container.py +5 -4
  3. {anydi-0.48.0 → anydi-0.48.2}/pyproject.toml +3 -3
  4. {anydi-0.48.0 → anydi-0.48.2}/README.md +0 -0
  5. {anydi-0.48.0 → anydi-0.48.2}/anydi/__init__.py +0 -0
  6. {anydi-0.48.0 → anydi-0.48.2}/anydi/_async.py +0 -0
  7. {anydi-0.48.0 → anydi-0.48.2}/anydi/_context.py +0 -0
  8. {anydi-0.48.0 → anydi-0.48.2}/anydi/_decorators.py +0 -0
  9. {anydi-0.48.0 → anydi-0.48.2}/anydi/_module.py +0 -0
  10. {anydi-0.48.0 → anydi-0.48.2}/anydi/_provider.py +0 -0
  11. {anydi-0.48.0 → anydi-0.48.2}/anydi/_scan.py +0 -0
  12. {anydi-0.48.0 → anydi-0.48.2}/anydi/_scope.py +0 -0
  13. {anydi-0.48.0 → anydi-0.48.2}/anydi/_typing.py +0 -0
  14. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/__init__.py +0 -0
  15. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/__init__.py +0 -0
  16. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/_container.py +0 -0
  17. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/_settings.py +0 -0
  18. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/_utils.py +0 -0
  19. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/apps.py +0 -0
  20. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/middleware.py +0 -0
  21. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/ninja/__init__.py +0 -0
  22. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/ninja/_operation.py +0 -0
  23. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/django/ninja/_signature.py +0 -0
  24. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/fastapi.py +0 -0
  25. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/faststream.py +0 -0
  26. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/pydantic_settings.py +0 -0
  27. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/pytest_plugin.py +0 -0
  28. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/starlette/__init__.py +0 -0
  29. {anydi-0.48.0 → anydi-0.48.2}/anydi/ext/starlette/middleware.py +0 -0
  30. {anydi-0.48.0 → anydi-0.48.2}/anydi/py.typed +0 -0
  31. {anydi-0.48.0 → anydi-0.48.2}/anydi/testing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anydi
3
- Version: 0.48.0
3
+ Version: 0.48.2
4
4
  Summary: Dependency Injection library
5
5
  Keywords: dependency injection,dependencies,di,async,asyncio,application
6
6
  Author: Anton Ruhlov
@@ -29,7 +29,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
29
29
  Requires-Dist: typing-extensions>=4.15.0,<5
30
30
  Requires-Dist: anyio>=3.7.1
31
31
  Requires-Dist: wrapt>=1.17.0,<2
32
- Requires-Python: ~=3.9
32
+ Requires-Python: >=3.9.0, <3.14
33
33
  Project-URL: Repository, https://github.com/antonrh/anydi
34
34
  Description-Content-Type: text/markdown
35
35
 
@@ -305,6 +305,7 @@ class Container:
305
305
  )
306
306
 
307
307
  unresolved_parameter = None
308
+ unresolved_exc: LookupError | None = None
308
309
  parameters: list[inspect.Parameter] = []
309
310
  scopes: dict[Scope, Provider] = {}
310
311
 
@@ -326,10 +327,11 @@ class Container:
326
327
 
327
328
  try:
328
329
  sub_provider = self._get_or_register_provider(parameter.annotation)
329
- except LookupError:
330
+ except LookupError as exc:
330
331
  if self._parameter_has_default(parameter, **defaults):
331
332
  continue
332
333
  unresolved_parameter = parameter
334
+ unresolved_exc = exc
333
335
  continue
334
336
 
335
337
  # Store first provider for each scope
@@ -349,7 +351,7 @@ class Container:
349
351
  "which has not been registered or set. To resolve this, ensure "
350
352
  f"that `{unresolved_parameter.name}` is registered before "
351
353
  f"attempting to use it."
352
- ) from None
354
+ ) from unresolved_exc
353
355
 
354
356
  # Check scope compatibility
355
357
  for sub_provider in scopes.values():
@@ -829,8 +831,7 @@ class Container:
829
831
  # Set inject marker interface
830
832
  parameter.default.interface = interface
831
833
 
832
- # TODO: temporary disable until strict is enforced (remove False)
833
- if False and not self.has_provider_for(interface):
834
+ if not self.has_provider_for(interface):
834
835
  raise LookupError(
835
836
  f"`{type_repr(call)}` has an unknown dependency parameter "
836
837
  f"`{parameter.name}` with an annotation of "
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "anydi"
3
- version = "0.48.0"
3
+ version = "0.48.2"
4
4
  description = "Dependency Injection library"
5
5
  authors = [{ name = "Anton Ruhlov", email = "antonruhlov@gmail.com" }]
6
- requires-python = "~=3.9"
6
+ requires-python = ">=3.9.0, <3.14"
7
7
  readme = "README.md"
8
8
  license = "MIT"
9
9
  keywords = [
@@ -141,7 +141,7 @@ omit = [
141
141
  ]
142
142
 
143
143
  [tool.bumpversion]
144
- current_version = "0.48.0"
144
+ current_version = "0.48.2"
145
145
  parse = """(?x)
146
146
  (?P<major>0|[1-9]\\d*)\\.
147
147
  (?P<minor>0|[1-9]\\d*)\\.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes