-
Improve
resolve()typing, by @sobolevn. -
Use
Selftype for Container, by @sobolevn. -
Improve typing of
inject, by @sobolevn. -
Do not ignore _globalns that is set via
inject(), by @sobolevn. Address an inconsistency:inject(globalsns=...)silently had no effect during class/init resolution even though the parameter was stored — users passing a customglobalsnswould get no error but also no result. The factory path already honoured it, so this brings the two resolution paths into.
parity. -
Drop support for Python <= 3.10.
-
Add Python 3.14 to the build matrix and to classifiers.
-
Remove Codecov from GitHub Workflow and from README.
-
Upgrade type annotations to Python >= 3.10.
-
Remove code checks for Python <= 3.10.
-
Support mixing
__init__parameters and class-level annotated properties for
dependency injection. Previously, when a class defined a custom__init__,
rodi would only inspect constructor parameters and ignore class-level type
annotations. Now both are resolved: constructor parameters are injected as
arguments, and any remaining class-level annotated properties are injected via
setattrafter instantiation. This enables patterns like:class MyService: extra_dep: ExtraDependency # injected via setattr def __init__(self, main_dep: MainDependency) -> None: self.main_dep = main_dep
Resolves issue #43, reported by @lucas-labs.
-
Add support for the decorator pattern
viaContainer.decorate(base_type, decorator_type). The decorator class must have an
__init__parameter whose type annotation matches the registered type; that parameter
receives the inner service instance, while all other parameters are resolved from the
container as usual. Decorators can be chained by callingdecorate()multiple times —
each call wraps the previous registration:container.add_singleton(IGreeter, SimpleGreeter) container.decorate(IGreeter, LoggingGreeter) # wraps SimpleGreeter container.decorate(IGreeter, CachingGreeter) # wraps LoggingGreeter # resolves as: CachingGreeter(LoggingGreeter(SimpleGreeter()))
Resolves issue #15, requested by @Eldar1205.