anydi 0.26.5__py3-none-any.whl → 0.26.7__py3-none-any.whl

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.
anydi/_utils.py CHANGED
@@ -6,7 +6,7 @@ import builtins
6
6
  import functools
7
7
  import inspect
8
8
  import sys
9
- from typing import Any, AsyncIterator, Callable, ForwardRef, Iterator, TypeVar, cast
9
+ from typing import Any, AsyncIterator, Callable, ForwardRef, Iterator, TypeVar
10
10
 
11
11
  from typing_extensions import ParamSpec, get_args, get_origin
12
12
 
@@ -16,21 +16,20 @@ except ImportError:
16
16
  anyio = None # type: ignore[assignment]
17
17
 
18
18
 
19
- if sys.version_info < (3, 9): # pragma: nocover
20
-
21
- def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:
22
- return type_._evaluate(globalns, localns) # noqa
23
-
24
- else:
25
-
26
- def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:
27
- return cast(Any, type_)._evaluate(globalns, localns, set()) # noqa
28
-
29
-
30
19
  T = TypeVar("T")
31
20
  P = ParamSpec("P")
32
21
 
33
22
 
23
+ def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:
24
+ if sys.version_info < (3, 9):
25
+ return type_._evaluate(globalns, localns) # noqa
26
+ elif sys.version_info >= (3, 12):
27
+ return type_._evaluate( # noqa
28
+ globalns, localns, frozenset(), recursive_guard=frozenset()
29
+ )
30
+ return type_._evaluate(globalns, localns, frozenset()) # noqa
31
+
32
+
34
33
  def get_full_qualname(obj: Any) -> str:
35
34
  """Get the fully qualified name of an object."""
36
35
  qualname = getattr(obj, "__qualname__", None)
@@ -70,10 +69,12 @@ def get_typed_annotation(
70
69
  ) -> Any:
71
70
  """Get the typed annotation of a parameter."""
72
71
  if isinstance(annotation, str):
73
- if sys.version_info < (3, 9):
74
- annotation = ForwardRef(annotation)
75
- else:
72
+ if sys.version_info >= (3, 10, 2):
76
73
  annotation = ForwardRef(annotation, module=module, is_class=is_class)
74
+ elif sys.version_info >= (3, 10, 0):
75
+ annotation = ForwardRef(annotation, module=module)
76
+ else:
77
+ annotation = ForwardRef(annotation)
77
78
  annotation = evaluate_forwardref(annotation, globalns, {})
78
79
  return annotation
79
80
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anydi
3
- Version: 0.26.5
3
+ Version: 0.26.7
4
4
  Summary: Dependency Injection library
5
5
  Home-page: https://github.com/antonrh/anydi
6
6
  License: MIT
@@ -22,7 +22,6 @@ Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
24
  Classifier: Programming Language :: Python :: 3 :: Only
25
- Classifier: Programming Language :: Python :: 3.7
26
25
  Classifier: Topic :: Internet
27
26
  Classifier: Topic :: Software Development
28
27
  Classifier: Topic :: Software Development :: Libraries
@@ -5,7 +5,7 @@ anydi/_logger.py,sha256=UpubJUnW83kffFxkhUlObm2DmZX1Pjqoz9YFKS-JOPg,52
5
5
  anydi/_module.py,sha256=E1TfLud_Af-MPB83PxIzHVA1jlDW2FGaRP_il1a6y3Y,3675
6
6
  anydi/_scanner.py,sha256=cyEk-K2Q8ssZStq8GrxMeEcCuAZMw-RXrjlgWEevKCs,6667
7
7
  anydi/_types.py,sha256=i8xFxz8pmFj7SGqwOwae_P9VtiRie6DVLwfaLibLwhc,3653
8
- anydi/_utils.py,sha256=zP4UvO1aVQJTB8pFNUWAcncvSiuhcg4xNdRU7CoLrqw,3871
8
+ anydi/_utils.py,sha256=TzUZRTNaXu78Uzv9NCNLSM5s9TgEIiXtXgr1HhsfHac,4017
9
9
  anydi/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  anydi/ext/django/__init__.py,sha256=QI1IABCVgSDTUoh7M9WMECKXwB3xvh04HfQ9TOWw1Mk,223
11
11
  anydi/ext/django/_container.py,sha256=cxVoYQG16WP0S_Yv4TnLwuaaT7NVEOhLWO-YdALJUb4,418
@@ -21,8 +21,8 @@ anydi/ext/pytest_plugin.py,sha256=3OWphc4nEzla46_8KR7LXtwGns5eol_YlUWfTf4Cr2Q,39
21
21
  anydi/ext/starlette/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  anydi/ext/starlette/middleware.py,sha256=Ni0BQaPjs_Ha6zcLZYYJ3-XkslTCnL9aCSa06rnRDMI,1139
23
23
  anydi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- anydi-0.26.5.dist-info/LICENSE,sha256=V6rU8a8fv6o2jQ-7ODHs0XfDFimot8Q6Km6CylRIDTo,1069
25
- anydi-0.26.5.dist-info/METADATA,sha256=3nX9kXIPWQy7roBSW5jEf3z0D_ODNtCy5MKEJQgKy-M,5160
26
- anydi-0.26.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
- anydi-0.26.5.dist-info/entry_points.txt,sha256=GmQblwzxFg42zva1HyBYJJ7TvrTIcSAGBHmyi3bvsi4,42
28
- anydi-0.26.5.dist-info/RECORD,,
24
+ anydi-0.26.7.dist-info/LICENSE,sha256=V6rU8a8fv6o2jQ-7ODHs0XfDFimot8Q6Km6CylRIDTo,1069
25
+ anydi-0.26.7.dist-info/METADATA,sha256=_z0STd3mxaFj3pfj4aEcX2C9wER-eVgC_wz9Z-DbkbA,5110
26
+ anydi-0.26.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
27
+ anydi-0.26.7.dist-info/entry_points.txt,sha256=GmQblwzxFg42zva1HyBYJJ7TvrTIcSAGBHmyi3bvsi4,42
28
+ anydi-0.26.7.dist-info/RECORD,,
File without changes