Releases: modern-python/modern-di
Releases · modern-python/modern-di
2.10.0
What's Changed
- Add context manager support, repr, and skip_creator_parsing warning by @lesnik512 in #165
Full Changelog: 2.9.0...2.10.0
2.9.0
What's Changed
Code fixes:
- Replaced all private typing._* internals with public get_origin() / get_args() / hasattr(metadata) API — future-proof across Python versions
- Silent NameError on unresolvable forward references now emits a UserWarning naming the creator and the missing annotation
- Removed misleading frozen=True from CacheRegistry, ContextRegistry, OverridesRegistry — all three mutate their dict fields in place
- ContainerProvider no longer requires post-construction mutation by the container — added ProvidersRegistry.register(type, provider) to map the container type directly, keeping bound_type=None permanently on the singleton
- Finalizer exceptions no longer abort remaining cleanup — both close_async() and close_sync() now run all finalizers, collect failures, and raise a combined RuntimeError at the end
Tooling:
- Migrated all 8 # type: ignore[...] suppressions to # ty: ignore[rule] after mypy was replaced by ty
Documentation:
- use_lock=False documented under Cached Factories
- Union resolution order documented in factories and resolving pages
- Override global scope behavior documented in testing fixtures
- Async finalizers vs sync-only resolution distinction added to migration guide
Tests:
- Added test_sync_finalizer_exception_does_not_abort_remaining_cleanup
- Added test_async_finalizer_exception_does_not_abort_remaining_cleanu
Full Changelog: 2.8.4...2.9.0
2.8.4
What's Changed
- add page about DI by @lesnik512 in #161
- add instruction about duplicate provider error by @lesnik512 in #162
Full Changelog: 2.8.3...2.8.4
2.8.3
2.8.2
2.8.1
What's Changed
- add frozen to dataclasses by @lesnik512 in #155
- migrate to ty by @lesnik512 in #156
- raise error for required but missing context by @lesnik512 in #157
Full Changelog: 2.8.0...2.8.1
2.8.0
What's Changed
- enhance error messages by @lesnik512 in #149
- enhance migration guide and refactor docs by @lesnik512 in #150
- add validate method to providers by @lesnik512 in #151
Full Changelog: 2.7.1...2.8.0
2.7.1
Fix publishing
Full Changelog: 2.7.0...2.7.1
2.7.0
What's Changed
- return migration guide from that-depends by @lesnik512 in #141
- update docs by @lesnik512 in #142
- move modern-di-fastapi to separate repo by @lesnik512 in #143
- move modern-di-litestar to separate repo by @lesnik512 in #144
- move modern-di-faststream to separate repo by @lesnik512 in #145
Full Changelog: 2.6.4...2.7.0
2.6.4
What's Changed
- fix type error for broken annotations by @lesnik512 in #140
Full Changelog: 2.6.3...2.6.4