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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anydi
3
- Version: 0.54.1
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
- <p align="center">
39
- <i>Modern, lightweight Dependency Injection library using type annotations.</i>
40
- </p>
41
-
42
- <p align="center">
43
- <a href="https://github.com/antonrh/anydi/actions/workflows/ci.yml" target="_blank">
44
- <img src="https://github.com/antonrh/anydi/actions/workflows/ci.yml/badge.svg" alt="CI">
45
- </a>
46
- <a href="https://codecov.io/gh/antonrh/anydi" target="_blank">
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
+ [![CI](https://github.com/antonrh/anydi/actions/workflows/ci.yml/badge.svg)](https://github.com/antonrh/anydi/actions/workflows/ci.yml)
43
+ [![Coverage](https://codecov.io/gh/antonrh/anydi/branch/main/graph/badge.svg)](https://codecov.io/gh/antonrh/anydi)
44
+ [![Documentation](https://readthedocs.org/projects/anydi/badge/?version=latest)](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
- <p align="center">
4
- <i>Modern, lightweight Dependency Injection library using type annotations.</i>
5
- </p>
6
-
7
- <p align="center">
8
- <a href="https://github.com/antonrh/anydi/actions/workflows/ci.yml" target="_blank">
9
- <img src="https://github.com/antonrh/anydi/actions/workflows/ci.yml/badge.svg" alt="CI">
10
- </a>
11
- <a href="https://codecov.io/gh/antonrh/anydi" target="_blank">
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
+ [![CI](https://github.com/antonrh/anydi/actions/workflows/ci.yml/badge.svg)](https://github.com/antonrh/anydi/actions/workflows/ci.yml)
8
+ [![Coverage](https://codecov.io/gh/antonrh/anydi/branch/main/graph/badge.svg)](https://codecov.io/gh/antonrh/anydi)
9
+ [![Documentation](https://readthedocs.org/projects/anydi/badge/?version=latest)](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 ._scope import Scope
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, TypeVar
2
+ from typing import Any
5
3
 
6
- import anyio.to_thread
7
- from typing_extensions import ParamSpec, Self
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: