Releases: modern-python/modern-di
Releases · modern-python/modern-di
2.2.0
What's Changed
- allow setting context after container creation by @lesnik512 in #127
Full Changelog: 2.1.1...2.2.0
2.1.1
What's Changed
- add typing.Annotated parsing by @lesnik512 in #123
- fix closing of di container in faststream integration by @lesnik512 in #126
Full Changelog: 2.1.0...2.1.1
2.1.0
What's Changed
- update docs by @lesnik512 in #121
- allow skipping annotations parsing and fix string annotations parsing by @lesnik512 in #122
Full Changelog: 2.0.0...2.1.0
2.0.0
What's Changed
- make sync only DI by @lesnik512 in #106
- resolve dependencies by annotations by @lesnik512 in #109
- resolve di container in annotations by @lesnik512 in #112
- implement factories finalization by @lesnik512 in #113
- implement overriding by type and name by @lesnik512 in #114
- enhance parsing signature, remove dict and list providers by @lesnik512 in #115
- update docs and add migration guide to 2.x by @lesnik512 in #120
This release introduces significant improvements to the dependency injection framework with a focus on simplification and enhanced functionality:
Key Enhancements
- Unified Container: Replaced separate AsyncContainer and SyncContainer with a single Container class supporting both paradigms
- Simplified Provider API: All providers now use keyword-only arguments for better clarity
- Consolidated Provider Types: Removed Singleton, Resource, Dict, and List providers, consolidating functionality into the Factory provider with CacheSettings
- Improved Caching: Enhanced caching mechanism through explicit CacheSettings in Factory providers
Breaking Changes
- Container initialization now uses Container() instead of AsyncContainer()/SyncContainer()
- Provider definitions require keyword arguments and updated caching patterns
- Container building no longer uses context managers
- Integration packages (FastAPI, LiteStar, FastStream) updated with simplified APIs
- Override mechanism changed to be more explicit with dependency names/types
Migration
Existing code requires updates to container initialization, provider definitions, and integration patterns.
For details refer to the migration guide.
Full Changelog: 1.1.0...2.0.0
2.0.0-alpha.5
What's Changed
- fix resolving in incorrect scope by @lesnik512 in #118
Full Changelog: 2.0.0-alpha.4...2.0.0-alpha.5
2.0.0-alpha.4
What's Changed
- enhance types parsing by @lesnik512 in #117
Full Changelog: 2.0.0-alpha.3...2.0.0-alpha.4
2.0.0-alpha.3
What's Changed
- fix cached factories resolving by @lesnik512 in #116
Full Changelog: 2.0.0-alpha.2...2.0.0-alpha.3
2.0.0-alpha.2
What's Changed
- enhance parsing signature, remove dict and list providers by @lesnik512 in #115
Full Changelog: 2.0.0-alpha.1...2.0.0-alpha.2
2.0.0-alpha.1
What's Changed
- arguments resolving by type annotations by @lesnik512 in #109
- resolve di container in annotations by @lesnik512 in #112
- implement factories finalization by @lesnik512 in #113
- implement overriding by type and name by @lesnik512 in #114
Full Changelog: 2.0.0-alpha...2.0.0-alpha.1
2.0.0-alpha
What's Changed
- make sync only DI by @lesnik512 in #106
- remove close method for container by @lesnik512 in #107
Full Changelog: 1.1.0...2.0.0-alpha