anydi 0.54.1__tar.gz → 0.55.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.
- {anydi-0.54.1 → anydi-0.55.0}/PKG-INFO +10 -16
- {anydi-0.54.1 → anydi-0.55.0}/README.md +9 -15
- {anydi-0.54.1 → anydi-0.55.0}/anydi/__init__.py +1 -2
- anydi-0.54.1/anydi/_async.py → anydi-0.55.0/anydi/_async_lock.py +3 -13
- {anydi-0.54.1 → anydi-0.55.0}/anydi/_container.py +83 -365
- {anydi-0.54.1 → anydi-0.55.0}/anydi/_context.py +27 -9
- {anydi-0.54.1 → anydi-0.55.0}/anydi/_decorators.py +1 -1
- {anydi-0.54.1 → anydi-0.55.0}/anydi/_provider.py +9 -38
- anydi-0.55.0/anydi/_resolver.py +563 -0
- anydi-0.54.1/anydi/_scan.py → anydi-0.55.0/anydi/_scanner.py +1 -1
- anydi-0.54.1/anydi/_typing.py → anydi-0.55.0/anydi/_types.py +22 -21
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/fastapi.py +1 -1
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/faststream.py +1 -1
- {anydi-0.54.1 → anydi-0.55.0}/anydi/testing.py +14 -48
- {anydi-0.54.1 → anydi-0.55.0}/pyproject.toml +1 -1
- anydi-0.54.1/anydi/_scope.py +0 -9
- {anydi-0.54.1 → anydi-0.55.0}/anydi/_module.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/__init__.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/django/__init__.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/pydantic_settings.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/pytest_plugin.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/starlette/__init__.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/ext/starlette/middleware.py +0 -0
- {anydi-0.54.1 → anydi-0.55.0}/anydi/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anydi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.55.0
|
|
4
4
|
Summary: Dependency Injection library
|
|
5
5
|
Keywords: dependency injection,dependencies,di,async,asyncio,application
|
|
6
6
|
Author: Anton Ruhlov
|
|
@@ -35,21 +35,15 @@ Description-Content-Type: text/markdown
|
|
|
35
35
|
|
|
36
36
|
# AnyDI
|
|
37
37
|
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<img src="https://codecov.io/gh/antonrh/anydi/branch/main/graph/badge.svg?token=67CLD19I0C" alt="Coverage">
|
|
48
|
-
</a>
|
|
49
|
-
<a href="https://anydi.readthedocs.io/en/latest/?badge=latest" target="_blank">
|
|
50
|
-
<img src="https://readthedocs.org/projects/anydi/badge/?version=latest" alt="Documentation">
|
|
51
|
-
</a>
|
|
52
|
-
</p>
|
|
38
|
+
<div style="text-align: center;">
|
|
39
|
+
|
|
40
|
+
Modern, lightweight Dependency Injection library using type annotations.
|
|
41
|
+
|
|
42
|
+
[](https://github.com/antonrh/anydi/actions/workflows/ci.yml)
|
|
43
|
+
[](https://codecov.io/gh/antonrh/anydi)
|
|
44
|
+
[](https://anydi.readthedocs.io/en/latest/)
|
|
45
|
+
|
|
46
|
+
</div>
|
|
53
47
|
|
|
54
48
|
---
|
|
55
49
|
Documentation
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
# AnyDI
|
|
2
2
|
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<img src="https://codecov.io/gh/antonrh/anydi/branch/main/graph/badge.svg?token=67CLD19I0C" alt="Coverage">
|
|
13
|
-
</a>
|
|
14
|
-
<a href="https://anydi.readthedocs.io/en/latest/?badge=latest" target="_blank">
|
|
15
|
-
<img src="https://readthedocs.org/projects/anydi/badge/?version=latest" alt="Documentation">
|
|
16
|
-
</a>
|
|
17
|
-
</p>
|
|
3
|
+
<div style="text-align: center;">
|
|
4
|
+
|
|
5
|
+
Modern, lightweight Dependency Injection library using type annotations.
|
|
6
|
+
|
|
7
|
+
[](https://github.com/antonrh/anydi/actions/workflows/ci.yml)
|
|
8
|
+
[](https://codecov.io/gh/antonrh/anydi)
|
|
9
|
+
[](https://anydi.readthedocs.io/en/latest/)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
18
12
|
|
|
19
13
|
---
|
|
20
14
|
Documentation
|
|
@@ -4,8 +4,7 @@ from ._container import Container
|
|
|
4
4
|
from ._decorators import injectable, provided, provider, request, singleton, transient
|
|
5
5
|
from ._module import Module
|
|
6
6
|
from ._provider import ProviderDef as Provider
|
|
7
|
-
from .
|
|
8
|
-
from ._typing import Inject
|
|
7
|
+
from ._types import Inject, Scope
|
|
9
8
|
|
|
10
9
|
# Alias for dependency auto marker
|
|
11
10
|
# TODO: deprecate it
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import functools
|
|
2
|
-
from collections.abc import Callable
|
|
3
1
|
from types import TracebackType
|
|
4
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
5
3
|
|
|
6
|
-
import anyio
|
|
7
|
-
from typing_extensions import
|
|
8
|
-
|
|
9
|
-
T = TypeVar("T")
|
|
10
|
-
P = ParamSpec("P")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async def run_sync(func: Callable[P, T], /, *args: P.args, **kwargs: P.kwargs) -> T:
|
|
14
|
-
"""Runs the given function asynchronously using the `anyio` library."""
|
|
15
|
-
return await anyio.to_thread.run_sync(functools.partial(func, *args, **kwargs))
|
|
4
|
+
import anyio
|
|
5
|
+
from typing_extensions import Self
|
|
16
6
|
|
|
17
7
|
|
|
18
8
|
class AsyncRLock:
|