python-injection 0.19.5.post0__tar.gz → 0.19.6__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.
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/PKG-INFO +1 -1
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/__init__.pyi +1 -1
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/module.py +11 -7
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/entrypoint.py +4 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/pyproject.toml +1 -1
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/.gitignore +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/LICENSE +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/README.md +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/__init__.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/__init__.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/asfunction.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/__init__.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/asynchronous.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/event.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/invertible.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/key.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/lazy.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/threading.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/type.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/descriptors.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/injectables.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/scope.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/slots.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/exceptions.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/ext/__init__.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/ext/fastapi.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/ext/fastapi.pyi +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/loaders.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/py.typed +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/testing/__init__.py +0 -0
- {python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/testing/__init__.pyi +0 -0
@@ -374,7 +374,7 @@ class Module:
|
|
374
374
|
*,
|
375
375
|
alias: bool = ...,
|
376
376
|
mode: Mode | ModeStr = ...,
|
377
|
-
) ->
|
377
|
+
) -> T:
|
378
378
|
"""
|
379
379
|
Function for registering a specific instance to be injected. This is useful for
|
380
380
|
registering global variables. The difference with the singleton decorator is
|
@@ -480,16 +480,15 @@ class Module(Broker, EventListener):
|
|
480
480
|
wrapper = contextmanager(wrapped)
|
481
481
|
|
482
482
|
else:
|
483
|
-
hint = (wrapped,) # type: ignore[assignment]
|
484
483
|
injectable_class = SimpleScopedInjectable
|
485
|
-
wrapper = wrapped # type: ignore[assignment]
|
484
|
+
hint = wrapper = wrapped # type: ignore[assignment]
|
486
485
|
|
487
486
|
self.injectable(
|
488
487
|
wrapper,
|
489
488
|
cls=partial(injectable_class, scope_name=scope_name),
|
490
489
|
ignore_type_hint=True,
|
491
490
|
inject=inject,
|
492
|
-
on=(
|
491
|
+
on=(hint, on),
|
493
492
|
mode=mode,
|
494
493
|
)
|
495
494
|
return wrapped
|
@@ -533,16 +532,21 @@ class Module(Broker, EventListener):
|
|
533
532
|
*,
|
534
533
|
alias: bool = False,
|
535
534
|
mode: Mode | ModeStr = Mode.get_default(),
|
536
|
-
) ->
|
537
|
-
|
535
|
+
) -> T:
|
536
|
+
if not alias:
|
537
|
+
on = (type(instance), on)
|
538
|
+
|
539
|
+
elif not on:
|
540
|
+
raise ValueError("`on` must be provided when `alias` is `True`.")
|
541
|
+
|
538
542
|
self.injectable(
|
539
543
|
lambda: instance,
|
540
544
|
ignore_type_hint=True,
|
541
545
|
inject=False,
|
542
|
-
on=
|
546
|
+
on=on,
|
543
547
|
mode=mode,
|
544
548
|
)
|
545
|
-
return
|
549
|
+
return instance
|
546
550
|
|
547
551
|
def reserve_scoped_slot[T](
|
548
552
|
self,
|
@@ -41,6 +41,10 @@ def autocall[T: Callable[..., Any]](
|
|
41
41
|
return decorator(wrapped) if wrapped else decorator
|
42
42
|
|
43
43
|
|
44
|
+
# SMP = Setup Method Parameters
|
45
|
+
# EPP = EntryPoint Parameters
|
46
|
+
|
47
|
+
|
44
48
|
@overload
|
45
49
|
def entrypointmaker[**SMP, **EPP, T1, T2](
|
46
50
|
wrapped: EntrypointSetupMethod[SMP, EPP, T1, T2],
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/__init__.py
RENAMED
File without changes
|
{python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/asynchronous.py
RENAMED
File without changes
|
File without changes
|
{python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/invertible.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{python_injection-0.19.5.post0 → python_injection-0.19.6}/injection/_core/common/threading.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|