Skip to content

Commit 243df7a

Browse files
authored
rename: 🚚 injection.utils -> injection.loaders
1 parent fdcccbc commit 243df7a

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

β€Žconftest.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from injection import Module, mod
88
from injection._core.module import Module as CoreModule
9-
from injection.utils import PythonModuleLoader
9+
from injection.loaders import PythonModuleLoader
1010
from tests.helpers import EventHistory
1111

1212
logging.basicConfig(level=logging.DEBUG)

β€Ždocumentation/utils.mdβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To load Injectable1 and Injectable2 into memory you can do the following:
1919

2020
```python
2121
# Imports
22-
from injection.utils import PythonModuleLoader
22+
from injection.loaders import PythonModuleLoader
2323
import package
2424
```
2525

@@ -64,7 +64,7 @@ PythonModuleLoader.endswith(f"_{profile}").load(package)
6464
`load_packages` is a simplified version of `PythonModuleLoader`.
6565

6666
```python
67-
from injection.utils import load_packages
67+
from injection.loaders import load_packages
6868

6969
import package
7070

@@ -87,7 +87,7 @@ from abc import abstractmethod
8787
from typing import Protocol
8888

8989
from injection import inject, mod, should_be_injectable, singleton
90-
from injection.utils import load_profile
90+
from injection.loaders import load_profile
9191

9292
@should_be_injectable
9393
class SMSService(Protocol):

β€Žinjection/ext/fastapi.pyβ€Ž

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from types import GenericAlias
2-
from typing import TYPE_CHECKING, Annotated, Any, TypeAliasType
2+
from typing import Annotated, Any, TypeAliasType
33

44
from fastapi import Depends
55

@@ -33,10 +33,6 @@ def __getitem__(self, params: Any, /) -> Any:
3333
return Annotated[cls, self(cls), *iter_params]
3434

3535

36-
if TYPE_CHECKING:
37-
type Inject[T, *Metadata] = Annotated[T, Depends(...), *Metadata]
38-
39-
else:
40-
Inject = FastAPIInject()
36+
Inject = FastAPIInject()
4137

4238
del FastAPIInject

β€Žinjection/ext/fastapi.pyiβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from typing import Annotated
2+
3+
from fastapi import Depends
4+
5+
type Inject[T, *Metadata] = Annotated[T, Depends(...), *Metadata]
File renamed without changes.

β€Žinjection/testing/__init__.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import ContextManager, Final
22

33
from injection import Module, mod
4-
from injection.utils import load_profile
4+
from injection.loaders import load_profile
55

66
__all__ = (
77
"load_test_profile",

β€Žtests/utils/test_load_profile.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from injection import find_instance, injectable, mod
2-
from injection.utils import load_profile
2+
from injection.loaders import load_profile
33

44

55
class TestLoadProfile:

β€Žtests/utils/test_python_module_loader.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from injection.utils import PythonModuleLoader, load_packages
3+
from injection.loaders import PythonModuleLoader, load_packages
44

55

66
class TestPythonModuleLoader:

0 commit comments

Comments
Β (0)