anydi 0.44.0__tar.gz → 0.45.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 (96) hide show
  1. {anydi-0.44.0 → anydi-0.45.0}/PKG-INFO +1 -1
  2. {anydi-0.44.0 → anydi-0.45.0}/anydi/_container.py +45 -48
  3. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/_utils.py +3 -2
  4. {anydi-0.44.0 → anydi-0.45.0}/anydi/testing.py +12 -16
  5. {anydi-0.44.0 → anydi-0.45.0}/docs/usage.md +1 -1
  6. {anydi-0.44.0 → anydi-0.45.0}/pyproject.toml +2 -2
  7. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/fastapi/test_ext.py +2 -0
  8. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/faststream/test_ext.py +2 -0
  9. {anydi-0.44.0 → anydi-0.45.0}/tests/test_container.py +8 -5
  10. {anydi-0.44.0 → anydi-0.45.0}/uv.lock +1 -1
  11. {anydi-0.44.0 → anydi-0.45.0}/.editorconfig +0 -0
  12. {anydi-0.44.0 → anydi-0.45.0}/.github/workflows/ci.yml +0 -0
  13. {anydi-0.44.0 → anydi-0.45.0}/.gitignore +0 -0
  14. {anydi-0.44.0 → anydi-0.45.0}/.readthedocs.yaml +0 -0
  15. {anydi-0.44.0 → anydi-0.45.0}/LICENSE +0 -0
  16. {anydi-0.44.0 → anydi-0.45.0}/Makefile +0 -0
  17. {anydi-0.44.0 → anydi-0.45.0}/README.md +0 -0
  18. {anydi-0.44.0 → anydi-0.45.0}/anydi/__init__.py +0 -0
  19. {anydi-0.44.0 → anydi-0.45.0}/anydi/_async.py +0 -0
  20. {anydi-0.44.0 → anydi-0.45.0}/anydi/_context.py +0 -0
  21. {anydi-0.44.0 → anydi-0.45.0}/anydi/_decorators.py +0 -0
  22. {anydi-0.44.0 → anydi-0.45.0}/anydi/_module.py +0 -0
  23. {anydi-0.44.0 → anydi-0.45.0}/anydi/_provider.py +0 -0
  24. {anydi-0.44.0 → anydi-0.45.0}/anydi/_scan.py +0 -0
  25. {anydi-0.44.0 → anydi-0.45.0}/anydi/_scope.py +0 -0
  26. {anydi-0.44.0 → anydi-0.45.0}/anydi/_typing.py +0 -0
  27. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/__init__.py +0 -0
  28. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/_utils.py +0 -0
  29. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/__init__.py +0 -0
  30. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/_container.py +0 -0
  31. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/_settings.py +0 -0
  32. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/apps.py +0 -0
  33. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/middleware.py +0 -0
  34. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/ninja/__init__.py +0 -0
  35. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/ninja/_operation.py +0 -0
  36. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/django/ninja/_signature.py +0 -0
  37. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/fastapi.py +0 -0
  38. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/faststream.py +0 -0
  39. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/pydantic_settings.py +0 -0
  40. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/pytest_plugin.py +0 -0
  41. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/starlette/__init__.py +0 -0
  42. {anydi-0.44.0 → anydi-0.45.0}/anydi/ext/starlette/middleware.py +0 -0
  43. {anydi-0.44.0 → anydi-0.45.0}/anydi/py.typed +0 -0
  44. {anydi-0.44.0 → anydi-0.45.0}/docs/examples/basic.md +0 -0
  45. {anydi-0.44.0 → anydi-0.45.0}/docs/extensions/django.md +0 -0
  46. {anydi-0.44.0 → anydi-0.45.0}/docs/extensions/fastapi.md +0 -0
  47. {anydi-0.44.0 → anydi-0.45.0}/docs/extensions/faststream.md +0 -0
  48. {anydi-0.44.0 → anydi-0.45.0}/docs/extensions/pydantic_settings.md +0 -0
  49. {anydi-0.44.0 → anydi-0.45.0}/docs/index.md +0 -0
  50. {anydi-0.44.0 → anydi-0.45.0}/mkdocs.yml +0 -0
  51. {anydi-0.44.0 → anydi-0.45.0}/tests/__init__.py +0 -0
  52. {anydi-0.44.0 → anydi-0.45.0}/tests/conftest.py +0 -0
  53. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/__init__.py +0 -0
  54. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/__init__.py +0 -0
  55. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/api/__init__.py +0 -0
  56. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/api/router.py +0 -0
  57. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/api/test_router.py +0 -0
  58. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/api/urls.py +0 -0
  59. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/conftest.py +0 -0
  60. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/container.py +0 -0
  61. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/scan/__init__.py +0 -0
  62. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/services.py +0 -0
  63. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/settings.py +0 -0
  64. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/test_views.py +0 -0
  65. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/urls.py +0 -0
  66. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/django/views.py +0 -0
  67. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/fastapi/__init__.py +0 -0
  68. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/fastapi/app.py +0 -0
  69. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/fastapi/conftest.py +0 -0
  70. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/fastapi/test_routes.py +0 -0
  71. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/faststream/__init__.py +0 -0
  72. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/faststream/test_subscribers.py +0 -0
  73. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/fixtures.py +0 -0
  74. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/starlette/__init__.py +0 -0
  75. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/starlette/app.py +0 -0
  76. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/starlette/conftest.py +0 -0
  77. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/starlette/test_routes.py +0 -0
  78. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/test_pydantic.py +0 -0
  79. {anydi-0.44.0 → anydi-0.45.0}/tests/ext/test_pytest_plugin.py +0 -0
  80. {anydi-0.44.0 → anydi-0.45.0}/tests/fixtures.py +0 -0
  81. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/__init__.py +0 -0
  82. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/__init__.py +0 -0
  83. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a1/__init__.py +0 -0
  84. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a1/handlers.py +0 -0
  85. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a2/__init__.py +0 -0
  86. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a2/a21/__init__.py +0 -0
  87. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a2/a21/handlers.py +0 -0
  88. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a3/__init__.py +0 -0
  89. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/a/a3/handlers.py +0 -0
  90. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/b/__init__.py +0 -0
  91. {anydi-0.44.0 → anydi-0.45.0}/tests/scan_app/b/handlers.py +0 -0
  92. {anydi-0.44.0 → anydi-0.45.0}/tests/test_decorators.py +0 -0
  93. {anydi-0.44.0 → anydi-0.45.0}/tests/test_module.py +0 -0
  94. {anydi-0.44.0 → anydi-0.45.0}/tests/test_scan.py +0 -0
  95. {anydi-0.44.0 → anydi-0.45.0}/tests/test_testing.py +0 -0
  96. {anydi-0.44.0 → anydi-0.45.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anydi
3
- Version: 0.44.0
3
+ Version: 0.45.0
4
4
  Summary: Dependency Injection library
5
5
  Project-URL: Repository, https://github.com/antonrh/anydi
6
6
  Author-email: Anton Ruhlov <antonruhlov@gmail.com>
@@ -399,9 +399,8 @@ class Container:
399
399
  self._set_provider(provider)
400
400
  return provider
401
401
 
402
- def _validate_provider_scope(
403
- self, scope: Scope, name: str, kind: ProviderKind
404
- ) -> None:
402
+ @staticmethod
403
+ def _validate_provider_scope(scope: Scope, name: str, kind: ProviderKind) -> None:
405
404
  """Validate the provider scope."""
406
405
  if scope not in (allowed_scopes := get_args(Scope)):
407
406
  raise ValueError(
@@ -431,10 +430,8 @@ class Container:
431
430
  ) -> Provider:
432
431
  """Get or register a provider by interface."""
433
432
  try:
434
- return self._get_provider(interface)
435
- except LookupError:
436
- if interface is inspect.Parameter.empty:
437
- raise
433
+ return self._providers[interface]
434
+ except KeyError:
438
435
  if inspect.isclass(interface) and not is_builtin_type(interface):
439
436
  # Try to get defined scope
440
437
  if is_provided(interface):
@@ -442,7 +439,12 @@ class Container:
442
439
  else:
443
440
  scope = parent_scope
444
441
  return self._register_provider(interface, scope, interface, **defaults)
445
- raise
442
+ raise LookupError(
443
+ f"The provider interface `{type_repr(interface)}` is either not "
444
+ "registered, not provided, or not set in the scoped context. "
445
+ "Please ensure that the provider interface is properly registered and "
446
+ "that the class is decorated with a scope before attempting to use it."
447
+ ) from None
446
448
 
447
449
  def _set_provider(self, provider: Provider) -> None:
448
450
  """Set a provider by interface."""
@@ -528,40 +530,34 @@ class Container:
528
530
  del context[interface]
529
531
 
530
532
  def _resolve_or_create(
531
- self, interface: type[T], create: bool, /, **defaults: Any
532
- ) -> T:
533
+ self, interface: Any, create: bool, /, **defaults: Any
534
+ ) -> Any:
533
535
  """Internal method to handle instance resolution and creation."""
534
536
  provider = self._get_or_register_provider(interface, None, **defaults)
535
537
  if provider.scope == "transient":
536
- instance = self._create_instance(provider, None, **defaults)
537
- else:
538
- context = self._get_instance_context(provider.scope)
539
- with context.lock():
540
- instance = (
541
- self._get_or_create_instance(provider, context)
542
- if not create
543
- else self._create_instance(provider, context, **defaults)
544
- )
545
-
546
- return cast(T, instance)
538
+ return self._create_instance(provider, None, **defaults)
539
+ context = self._get_instance_context(provider.scope)
540
+ with context.lock():
541
+ return (
542
+ self._get_or_create_instance(provider, context)
543
+ if not create
544
+ else self._create_instance(provider, context, **defaults)
545
+ )
547
546
 
548
547
  async def _aresolve_or_create(
549
- self, interface: type[T], create: bool, /, **defaults: Any
550
- ) -> T:
548
+ self, interface: Any, create: bool, /, **defaults: Any
549
+ ) -> Any:
551
550
  """Internal method to handle instance resolution and creation asynchronously."""
552
551
  provider = self._get_or_register_provider(interface, None, **defaults)
553
552
  if provider.scope == "transient":
554
- instance = await self._acreate_instance(provider, None, **defaults)
555
- else:
556
- context = self._get_instance_context(provider.scope)
557
- async with context.alock():
558
- instance = (
559
- await self._aget_or_create_instance(provider, context)
560
- if not create
561
- else await self._acreate_instance(provider, context, **defaults)
562
- )
563
-
564
- return cast(T, instance)
553
+ return await self._acreate_instance(provider, None, **defaults)
554
+ context = self._get_instance_context(provider.scope)
555
+ async with context.alock():
556
+ return (
557
+ await self._aget_or_create_instance(provider, context)
558
+ if not create
559
+ else await self._acreate_instance(provider, context, **defaults)
560
+ )
565
561
 
566
562
  def _get_or_create_instance(
567
563
  self, provider: Provider, context: InstanceContext
@@ -652,10 +648,9 @@ class Container:
652
648
  """Retrieve the arguments for a provider."""
653
649
  provided_kwargs = {}
654
650
  for parameter in provider.parameters:
655
- instance, _ = self._get_provider_instance(
651
+ provided_kwargs[parameter.name] = self._get_provider_instance(
656
652
  provider, parameter, context, **defaults
657
653
  )
658
- provided_kwargs[parameter.name] = instance
659
654
  return {**defaults, **provided_kwargs}
660
655
 
661
656
  def _get_provider_instance(
@@ -665,12 +660,12 @@ class Container:
665
660
  context: InstanceContext | None,
666
661
  /,
667
662
  **defaults: Any,
668
- ) -> tuple[Any, bool]:
663
+ ) -> Any:
669
664
  """Retrieve an instance of a dependency from the scoped context."""
670
665
 
671
666
  # Try to get instance from defaults
672
667
  if parameter.name in defaults:
673
- return defaults[parameter.name], True
668
+ return defaults[parameter.name]
674
669
 
675
670
  # Try to get instance from context
676
671
  elif context and parameter.annotation in context:
@@ -683,8 +678,8 @@ class Container:
683
678
  except LookupError:
684
679
  if parameter.default is inspect.Parameter.empty:
685
680
  raise
686
- return parameter.default, True
687
- return instance, False
681
+ return parameter.default
682
+ return instance
688
683
 
689
684
  async def _aget_provided_kwargs(
690
685
  self, provider: Provider, context: InstanceContext | None, /, **defaults: Any
@@ -692,10 +687,9 @@ class Container:
692
687
  """Asynchronously retrieve the arguments for a provider."""
693
688
  provided_kwargs = {}
694
689
  for parameter in provider.parameters:
695
- instance, _ = await self._aget_provider_instance(
690
+ provided_kwargs[parameter.name] = await self._aget_provider_instance(
696
691
  provider, parameter, context, **defaults
697
692
  )
698
- provided_kwargs[parameter.name] = instance
699
693
  return {**defaults, **provided_kwargs}
700
694
 
701
695
  async def _aget_provider_instance(
@@ -705,12 +699,12 @@ class Container:
705
699
  context: InstanceContext | None,
706
700
  /,
707
701
  **defaults: Any,
708
- ) -> tuple[Any, bool]:
702
+ ) -> Any:
709
703
  """Asynchronously retrieve an instance of a dependency from the context."""
710
704
 
711
705
  # Try to get instance from defaults
712
706
  if parameter.name in defaults:
713
- return defaults[parameter.name], True
707
+ return defaults[parameter.name]
714
708
 
715
709
  # Try to get instance from context
716
710
  elif context and parameter.annotation in context:
@@ -723,20 +717,20 @@ class Container:
723
717
  except LookupError:
724
718
  if parameter.default is inspect.Parameter.empty:
725
719
  raise
726
- return parameter.default, True
727
- return instance, False
720
+ return parameter.default
721
+ return instance
728
722
 
729
723
  def _resolve_parameter(
730
724
  self, provider: Provider, parameter: inspect.Parameter
731
725
  ) -> Any:
732
726
  self._validate_resolvable_parameter(provider, parameter)
733
- return self.resolve(parameter.annotation)
727
+ return self._resolve_or_create(parameter.annotation, False)
734
728
 
735
729
  async def _aresolve_parameter(
736
730
  self, provider: Provider, parameter: inspect.Parameter
737
731
  ) -> Any:
738
732
  self._validate_resolvable_parameter(provider, parameter)
739
- return await self.aresolve(parameter.annotation)
733
+ return await self._aresolve_or_create(parameter.annotation, False)
740
734
 
741
735
  def _validate_resolvable_parameter(
742
736
  self, provider: Provider, parameter: inspect.Parameter
@@ -822,6 +816,9 @@ class Container:
822
816
  self, call: Callable[..., Any], parameter: inspect.Parameter
823
817
  ) -> None:
824
818
  """Validate an injected parameter."""
819
+ # TODO: temporary disable until strict is enforced
820
+ return None
821
+
825
822
  if parameter.annotation is inspect.Parameter.empty:
826
823
  raise TypeError(
827
824
  f"Missing `{type_repr(call)}` parameter `{parameter.name}` annotation."
@@ -62,15 +62,16 @@ def register_components(container: Container) -> None:
62
62
  def inject_urlpatterns(container: Container, *, urlconf: str) -> None:
63
63
  """Auto-inject the container into views."""
64
64
  resolver = get_resolver(urlconf)
65
+ injected_urlpatterns = []
65
66
  for pattern in iter_urlpatterns(resolver.url_patterns):
66
67
  # Skip already injected views
67
- if hasattr(pattern.callback, "_injected"):
68
+ if pattern.lookup_str in injected_urlpatterns:
68
69
  continue
69
70
  # Skip django-ninja views
70
71
  if pattern.lookup_str.startswith("ninja."):
71
72
  continue # pragma: no cover
72
73
  pattern.callback = container.inject(pattern.callback)
73
- pattern.callback._injected = True # type: ignore
74
+ injected_urlpatterns.append(pattern.lookup_str)
74
75
 
75
76
 
76
77
  def iter_urlpatterns(
@@ -2,7 +2,7 @@ import contextlib
2
2
  import inspect
3
3
  import logging
4
4
  from collections.abc import Iterable, Iterator, Sequence
5
- from typing import Any, TypeVar, cast
5
+ from typing import Any, TypeVar
6
6
 
7
7
  import wrapt # type: ignore
8
8
  from typing_extensions import Self
@@ -65,18 +65,18 @@ class TestContainer(Container):
65
65
  self._override_instances.pop(interface, None)
66
66
 
67
67
  def _resolve_or_create(
68
- self, interface: type[T], create: bool, /, **defaults: Any
69
- ) -> T:
68
+ self, interface: Any, create: bool, /, **defaults: Any
69
+ ) -> Any:
70
70
  """Internal method to handle instance resolution and creation."""
71
71
  instance = super()._resolve_or_create(interface, create, **defaults)
72
- return cast(T, self._patch_resolver(interface, instance))
72
+ return self._patch_resolver(interface, instance)
73
73
 
74
74
  async def _aresolve_or_create(
75
- self, interface: type[T], create: bool, /, **defaults: Any
76
- ) -> T:
75
+ self, interface: Any, create: bool, /, **defaults: Any
76
+ ) -> Any:
77
77
  """Internal method to handle instance resolution and creation asynchronously."""
78
78
  instance = await super()._aresolve_or_create(interface, create, **defaults)
79
- return cast(T, self._patch_resolver(interface, instance))
79
+ return self._patch_resolver(interface, instance)
80
80
 
81
81
  def _get_provider_instance(
82
82
  self,
@@ -87,12 +87,10 @@ class TestContainer(Container):
87
87
  **defaults: Any,
88
88
  ) -> Any:
89
89
  """Retrieve an instance of a dependency from the scoped context."""
90
- instance, is_default = super()._get_provider_instance(
90
+ instance = super()._get_provider_instance(
91
91
  provider, parameter, context, **defaults
92
92
  )
93
- if not is_default:
94
- instance = InstanceProxy(instance, interface=parameter.annotation)
95
- return instance, is_default
93
+ return InstanceProxy(instance, interface=parameter.annotation)
96
94
 
97
95
  async def _aget_provider_instance(
98
96
  self,
@@ -103,14 +101,12 @@ class TestContainer(Container):
103
101
  **defaults: Any,
104
102
  ) -> Any:
105
103
  """Asynchronously retrieve an instance of a dependency from the context."""
106
- instance, is_default = await super()._aget_provider_instance(
104
+ instance = await super()._aget_provider_instance(
107
105
  provider, parameter, context, **defaults
108
106
  )
109
- if not is_default:
110
- instance = InstanceProxy(instance, interface=parameter.annotation)
111
- return instance, is_default
107
+ return InstanceProxy(instance, interface=parameter.annotation)
112
108
 
113
- def _patch_resolver(self, interface: type[Any], instance: Any) -> Any:
109
+ def _patch_resolver(self, interface: Any, instance: Any) -> Any:
114
110
  """Patch the test resolver for the instance."""
115
111
  if interface in self._override_instances:
116
112
  return self._override_instances[interface]
@@ -178,7 +178,7 @@ from typing import Iterator
178
178
 
179
179
  from anydi import Container
180
180
 
181
- container = Container() # Non-strict mode
181
+ container = Container()
182
182
 
183
183
  @container.provider(scope="singleton")
184
184
  def db() -> Iterator[Database]:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "anydi"
3
- version = "0.44.0"
3
+ version = "0.45.0"
4
4
  description = "Dependency Injection library"
5
5
  authors = [{ name = "Anton Ruhlov", email = "antonruhlov@gmail.com" }]
6
6
  requires-python = "~=3.9"
@@ -137,7 +137,7 @@ omit = [
137
137
  ]
138
138
 
139
139
  [tool.bumpversion]
140
- current_version = "0.44.0"
140
+ current_version = "0.45.0"
141
141
  parse = """(?x)
142
142
  (?P<major>0|[1-9]\\d*)\\.
143
143
  (?P<minor>0|[1-9]\\d*)\\.
@@ -14,6 +14,7 @@ def test_inject_param_missing_interface() -> None:
14
14
  _ = param.interface
15
15
 
16
16
 
17
+ @pytest.mark.skip(reason="disable until strict is enforced")
17
18
  def test_install_without_annotation() -> None:
18
19
  container = Container()
19
20
 
@@ -33,6 +34,7 @@ def test_install_without_annotation() -> None:
33
34
  install(app, container)
34
35
 
35
36
 
37
+ @pytest.mark.skip(reason="disable until strict is enforced")
36
38
  def test_install_unknown_annotation() -> None:
37
39
  container = Container()
38
40
 
@@ -14,6 +14,7 @@ def test_inject_param_missing_interface() -> None:
14
14
  _ = param.interface
15
15
 
16
16
 
17
+ @pytest.mark.skip(reason="disable until strict is enforced")
17
18
  def test_install_without_annotation() -> None:
18
19
  container = Container()
19
20
 
@@ -33,6 +34,7 @@ def test_install_without_annotation() -> None:
33
34
  install(broker, container)
34
35
 
35
36
 
37
+ @pytest.mark.skip(reason="disable until strict is enforced")
36
38
  def test_install_unknown_annotation() -> None:
37
39
  container = Container()
38
40
 
@@ -962,9 +962,10 @@ class TestContainer:
962
962
  with pytest.raises(
963
963
  LookupError,
964
964
  match=(
965
- "The provider interface for `str` has not been registered. Please "
966
- "ensure that the provider interface is properly registered before "
967
- "attempting to use it."
965
+ "The provider interface `str` is either not registered, not provided, "
966
+ "or not set in the scoped context. Please ensure that the provider "
967
+ "interface is properly registered and that the class is decorated "
968
+ "with a scope before attempting to use it."
968
969
  ),
969
970
  ):
970
971
  container.resolve(str)
@@ -1419,15 +1420,17 @@ class TestContainerInjector:
1419
1420
 
1420
1421
  assert result == "service ident = 1000"
1421
1422
 
1423
+ @pytest.mark.skip(reason="disable until strict is enforced")
1422
1424
  def test_inject_missing_annotation(self, container: Container) -> None:
1423
- def handler(name=auto) -> str: # type: ignore[no-untyped-def]
1424
- return name # type: ignore[no-any-return]
1425
+ def handler(name=auto) -> str: # type: ignore
1426
+ return name # type: ignore
1425
1427
 
1426
1428
  with pytest.raises(
1427
1429
  TypeError, match="Missing `(.*?).handler` parameter `name` annotation."
1428
1430
  ):
1429
1431
  container.inject(handler)
1430
1432
 
1433
+ @pytest.mark.skip(reason="disable until strict is enforced")
1431
1434
  def test_inject_unknown_dependency_using_strict_mode(self) -> None:
1432
1435
  container = Container()
1433
1436
 
@@ -13,7 +13,7 @@ wheels = [
13
13
 
14
14
  [[package]]
15
15
  name = "anydi"
16
- version = "0.43.0"
16
+ version = "0.45.0"
17
17
  source = { editable = "." }
18
18
  dependencies = [
19
19
  { name = "anyio" },
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
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes