anydi 0.27.0a2__tar.gz → 0.27.0a3__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 (29) hide show
  1. {anydi-0.27.0a2 → anydi-0.27.0a3}/PKG-INFO +1 -1
  2. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/faststream.py +12 -2
  3. {anydi-0.27.0a2 → anydi-0.27.0a3}/pyproject.toml +1 -1
  4. {anydi-0.27.0a2 → anydi-0.27.0a3}/LICENSE +0 -0
  5. {anydi-0.27.0a2 → anydi-0.27.0a3}/README.md +0 -0
  6. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/__init__.py +0 -0
  7. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_container.py +0 -0
  8. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_context.py +0 -0
  9. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_logger.py +0 -0
  10. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_module.py +0 -0
  11. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_scanner.py +0 -0
  12. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_types.py +0 -0
  13. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/_utils.py +0 -0
  14. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/__init__.py +0 -0
  15. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/_utils.py +0 -0
  16. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/__init__.py +0 -0
  17. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/_container.py +0 -0
  18. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/_settings.py +0 -0
  19. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/_utils.py +0 -0
  20. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/apps.py +0 -0
  21. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/middleware.py +0 -0
  22. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/ninja/__init__.py +0 -0
  23. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/ninja/_operation.py +0 -0
  24. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/django/ninja/_signature.py +0 -0
  25. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/fastapi.py +0 -0
  26. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/pytest_plugin.py +0 -0
  27. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/starlette/__init__.py +0 -0
  28. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/ext/starlette/middleware.py +0 -0
  29. {anydi-0.27.0a2 → anydi-0.27.0a3}/anydi/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anydi
3
- Version: 0.27.0a2
3
+ Version: 0.27.0a3
4
4
  Summary: Dependency Injection library
5
5
  Home-page: https://github.com/antonrh/anydi
6
6
  License: MIT
@@ -26,12 +26,22 @@ def install(broker: BrokerUsecase[Any, Any], container: Container) -> None:
26
26
  """
27
27
  broker._container = container # type: ignore[attr-defined]
28
28
 
29
- for subscriber in broker._subscribers.values(): # noqa
30
- call = subscriber.calls[0].handler._original_call # noqa
29
+ for handler in _get_broken_handlers(broker):
30
+ call = handler._original_call # noqa
31
31
  for parameter in get_typed_parameters(call):
32
32
  patch_call_parameter(call, parameter, container)
33
33
 
34
34
 
35
+ def _get_broken_handlers(broker: BrokerUsecase[Any, Any]) -> list[Any]:
36
+ if hasattr(broker, "handlers"):
37
+ return [handler.calls[0][0] for handler in broker.handlers.values()]
38
+ # faststream > 0.5.0
39
+ return [
40
+ subscriber.calls[0].handler
41
+ for subscriber in broker._subscribers.values() # noqa
42
+ ]
43
+
44
+
35
45
  def get_container(broker: BrokerUsecase[Any, Any]) -> Container:
36
46
  return cast(Container, getattr(broker, "_container")) # noqa
37
47
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "anydi"
3
- version = "0.27.0a2"
3
+ version = "0.27.0a3"
4
4
  description = "Dependency Injection library"
5
5
  authors = ["Anton Ruhlov <antonruhlov@gmail.com>"]
6
6
  license = "MIT"
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