Add new api, new deps system
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,4 +3,4 @@
|
||||
|
||||
poetry.lock
|
||||
|
||||
*/__pycache__/
|
||||
**/__pycache__/
|
||||
|
||||
@@ -2,7 +2,8 @@ from .neko.interfaces import (
|
||||
inject_module,
|
||||
inject_modules,
|
||||
inject_object,
|
||||
get_injected_object
|
||||
get_injected_objects,
|
||||
get_injected_object,
|
||||
)
|
||||
|
||||
|
||||
@@ -10,5 +11,6 @@ __all__ = [
|
||||
'inject_module',
|
||||
'inject_modules',
|
||||
'inject_object',
|
||||
'get_injected_objects',
|
||||
'get_injected_object'
|
||||
]
|
||||
|
||||
@@ -17,10 +17,14 @@ def inject_object(*objects) -> None:
|
||||
continue
|
||||
|
||||
|
||||
def get_injected_object(*objects: Type[T]) -> Iterable[T]:
|
||||
def get_injected_objects(*objects: Type[T]) -> Iterable[T]:
|
||||
return [apply_replace(obj) for obj in objects]
|
||||
|
||||
|
||||
def get_injected_object(obj: Type[T]) -> T:
|
||||
return apply_replace(obj)
|
||||
|
||||
|
||||
def inject_module(mod: ModuleType) -> None:
|
||||
try:
|
||||
inject_object(*getattr(mod, '__replacements__'))
|
||||
|
||||
@@ -2,6 +2,7 @@ from ..modules.variants import (
|
||||
inject_module,
|
||||
inject_modules,
|
||||
inject_object,
|
||||
get_injected_objects,
|
||||
get_injected_object
|
||||
)
|
||||
|
||||
@@ -10,5 +11,6 @@ __all__ = [
|
||||
'inject_module',
|
||||
'inject_modules',
|
||||
'inject_object',
|
||||
'get_injected_objects',
|
||||
'get_injected_object'
|
||||
]
|
||||
|
||||
@@ -7,8 +7,9 @@ readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
neko-configparser = {git="https://github.com/nekomatad/neko-configparser"}
|
||||
#neko-configparser = {path = "../neko-configparser", develop = true}
|
||||
|
||||
[tool.poetry.group.neko.dependencies]
|
||||
neko-configparser = {path = "../neko-configparser", develop = true}
|
||||
|
||||
|
||||
[build-system]
|
||||
|
||||
Reference in New Issue
Block a user