Changelog¶
This document describes all the changes in Dependency Injector framework that were made in every particular version.
From version 0.7.6 Dependency Injector framework strictly follows Semantic versioning
4.48.2¶
Add
warn_unresolved=TruetoWiringConfigurationandcontainer.wire()to produce warnings on unresolved string identifiers.ABI3 wheels are now built only for CPython version >=3.10 (see issue #919).
4.48.1¶
Improve performance of
dependency_injector._cwiring.DependencyResolverAdd
typing-extensionsas a dependency for older Python versions (<3.11)Produce warning on
@inject``s without ``Provide[...]marksAdd support for resource_type in ``Lifespan``s
4.48.0¶
Improve performance of wiring (#897)
Add Context Manager support to Resource provider (#899)
Add support for async generator injections (#900)
Fix unintended dependency on
typing_extensions(#902)Add support for Fast Depends (#898)
Add
resource_typeparameter to init and shutdown resources using specialized providers (#858)
4.47.1¶
Fix typing for wiring marker (#892)
Strip debug symbols in wheels
4.47.0¶
Add support for
Annotatedtype for module and class attribute injection in wiring, with updated documentation and examples. See discussion: https://github.com/ets-labs/python-dependency-injector/pull/721#issuecomment-2025263718Fix
rootproperty shadowing inConfigurationOption(#875)Fix incorrect monkeypatching during
wire()that could violate MRO in some classes (#886)ABI3 wheels are now published for CPython.
Drop support of Python 3.7.
4.46.0¶
Add option to disable env var interpolation in configs (#861)
Fix
Closingdependency resolution (#852)Add support for
inspect.iscoroutinefunction()inCoroutineprovider (#830)Fix broken wiring of sync inject-decorated methods (#673)
Documentation updates for movie-lister example (#747)
Fix type propagation in
Provider.provider(#744)
Many thanks for the contributions to: - ZipFile - Yegor Statkevich - Federico Tomasi - Martin Lafrance - Philip Bjorge - Ilya Kazakov
4.45.0¶
Add Starlette lifespan handler implementation (#683).
Raise exception in
ThreadLocalSingletoninstead of hiding it in finally (#845).Improve debuggability of
deepcopyerrors (#839).Update examples (#838).
Upgrade testing dependencies (#837).
Add minor fixes to the documentation (#709).
Remove
sixfrom the dependencies (3ba4704).
Many thanks for the contributions to: - ZipFile - František Trebuňa - JC (Jonathan Chen)
4.44.0¶
Many thanks to ZipFile for both contributions.
4.43.0¶
4.42.0¶
Promote release
4.42.0b1to a production release.Fix the Disqus comment widget.
4.42.0b1¶
Add support of Python 3.12.
Drop support of Python 2.7, 3.5, and 3.6.
Regenerate C sources using Cython 0.29.37.
Update
cibuildwheelto version2.20.0.
4.41.0¶
Add support of Python 3.11.
Allow Closing to detect dependent resources #633, #636. Thanks Jamie Stumme @StummeJ for the contribution.
Update CI/CD to use Ubuntu 22.04.
Update CI/CD to
actions/checkout@v3,actions/setup-python@v4,actions/upload-artifact@v3,pypa/cibuildwheel@v2.11.3, andactions/download-artifact@v3.Fix install crash on non-utf8 systems #644.
Fix a bug in Windows build with default charset #635.
Update FastAPI Redis example to use
aioredisversion 2 #613.Update documentation on creating custom providers #598.
Regenerate C sources using Cython 0.29.32.
Fix builds badge.
4.40.0¶
Add
Configuration.from_json()method to load configuration from a json file.Fix bug with wiring not working properly with functions double wrapped by
@functools.wrapsdecorator. See issue: #454. Many thanks to: @platipo, @MatthieuMoreau0, @fabiocerqueira, @Jitesh-Khuttan.Refactor wiring module to store all patched callable data in the
PatchedRegistry.Improve wording on the “Dependency injection and inversion of control in Python” docs page.
Add documentation on the
@injectdecorator.Update typing in the main example and cohesion/coupling correlation definition in “Dependency injection and inversion of control in Python”. Thanks to @illia-v (Illia Volochii) for the PR (#580).
Update copyright year.
Enable skipped test
test_schema_with_boto3_session().Update pytest configuration.
Regenerate C sources using Cython 0.29.30.
4.39.1¶
Fix bug #574: “
@injectbreaksinspect.iscoroutinefunction”. Thanks to @burritoatspoton (Rafał Burczyński) for reporting the issue.
4.39.0¶
Optimize injections and wiring from x1.5 to x7 times depending on the use case.
Fix bug #569: “numpy.typing.NDArray breaks wiring”. Thanks to @VKFisher (Vlad Fisher) for reporting the issue and providing a fix.
4.38.0¶
Add new provider
Aggregate. It is a generalized version ofFactoryAggregatethat can contain providers of any type, not onlyFactory. See issue #530. Thanks to @zerlok (Danil Troshnev) for suggesting the feature.Add argument
as_to theconfig.from_env()method for the explicit type casting of an environment variable value, e.g.:config.timeout.from_env("TIMEOUT", as_=int). See issue #533. Thanks to @gtors (Andrey Torsunov) for suggesting the feature.Add
.providersattribute to theFactoryAggregateprovider. It is an alias forFactoryAggregate.factoriesattribute.Add
.set_providers()method to theFactoryAggregateprovider. It is an alias forFactoryAggregate.set_factories()method.Add string imports for
Factory,Singleton,Callable,Resource, andCoroutineproviders, e.g.Factory("module.Class"). See issue #531. Thanks to @al-stefanitsky-mozdor for suggesting the feature.Fix
Dependencyprovider to don’t raise “Dependency is not defined” error when thedefaultis a falsy value of proper type. See issue #550. Thanks to @approxit for reporting the issue.Refactor
FactoryAggregateprovider internals.Update logo on Github and in docs to support dark themes and remove some imperfections.
4.37.0¶
Add support of Python 3.10.
Improve wiring with adding importing modules and packages from a string
container.wire(modules=["yourapp.module1"]).Add container wiring configuration
wiring_config = containers.WiringConfiguration().Add support of
withstatement forcontainer.override_providers()method.Add
Configuration(yaml_files=[...])argument.Add
Configuration(ini_files=[...])argument.Add
Configuration(pydantic_settings=[...])argument.Drop support of Python 3.4. There are no immediate breaking changes, but Dependency Injector will no longer be tested on Python 3.4 and any bugs will not be fixed.
Announce the date of dropping Python 3.5 support (Jan 1st 2022).
Fix
Dependency.is_definedattribute to always return boolean value.Fix
envs_required=Falsebehavior inConfiguration.from_*()methods to give a priority to the explicitly provided value.Update documentation and fix typos.
Regenerate C sources using Cython 0.29.24.
Migrate tests to
pytest.
4.36.2¶
Update docs.
4.36.1¶
Fix a wiring bug with improper resolving of
Provide[some_provider.provider].Fix a typo in
Factoryprovider docsservice.add_attributes(clent=client)#499. Thanks to @rajanjha786 for the contribution.Fix a typo in
boto3example #511. Thanks to @whysage for the contribution.
4.36.0¶
Add support of non-string keys for
FactoryAggregateprovider.Improve
FactoryAggregatetyping stub.Improve resource subclasses typing and make shutdown definition optional PR #492. Thanks to @EdwardBlair for suggesting the improvement.
Fix type annotations for
.provides. Thanks to Thiago Hiromi @thiromi for the fix PR #491.Fix environment variables interpolation examples in configuration provider docs
{$ENV} -> ${ENV}. Thanks to Felipe Rubio @krouw for reporting the issue and fixing yaml example PR #494.Fix
@containers.copy()decorator to respect dependencies on parent providers. See issue #477. Thanks to Andrey Torsunov @gtors for reporting the issue.Fix typing stub for
container.override_providers()to accept other types besidesProvider.Fix runtime issue with generic typing in resource initializer classes
resources.Resourceandresources.AsyncResource. See issue #488. Thanks to @EdwardBlair for reporting the issue.
4.35.3¶
This release was removed from PyPI. It was inconsistently published because project has reached a PyPI size limit. Changes from this release are published on PyPI in next version.
4.35.2¶
4.35.1¶
4.35.0¶
Add support of six 1.16.0.
4.34.2¶
Fix a bug with reverse shutdown order in
container.shutdown_resources(). See issue #432. Thanks to Saulius Beinorius for bringing up the issue.
4.34.1¶
Update
container.shutdown_resources()to respect dependencies order while shutdown. See issue #432. Thanks to Saulius Beinorius for bringing up the issue.
4.34.0¶
Add option
envs_requiredfor configuration provider.from_yaml()and.from_ini()methods. Withenvs_required=Truemethods.from_yaml()and.from_ini()raise an exception when encounter an undefined environment variable in the configuration file. By default this option is set to false for preserving previous behaviorenvs_required=False.Add raising of an exception in configuration provider strict mode when provider encounters an undefined environment variable in the configuration file.
Update configuration provider environment variables interpolation to replace undefined environment variables with an empty value.
Update configuration provider to perform environment variables interpolation before passing configuration file content to the parser.
4.33.0¶
Add support of default value for environment variable in INI and YAML configuration files with
${ENV_NAME:default}format. See issue #459. Thanks to Maksym Shemet @hbmshemet for suggesting the feature.Add method
Configuration.from_value(). See issue #462. Thanks to Mr. Slack Clone for bringing it up in the comments for configuration provider docs.
4.32.3¶
This fix a typo in
di_in_python.rstdoc. Thanks to @loingo95 for the fix.
4.32.2¶
4.32.1¶
4.32.0¶
Add
ContextLocalSingletonprovider. See PR: #443. Thanks to @sonthonaxrk for the contribution.Regenerate C sources using Cython 0.29.22.
4.31.2¶
Fix an issue with
Dictprovider non-string keys. See issue: #435. Thanks to @daniel55411 for reporting the issue.Fix Flask scoped contexts example. See issue: #440. Thanks to @sonthonaxrk for the contribution.
4.31.1¶
Fix
ThreadSafeSingletonsynchronization issue. See issue: #433. Thanks to @garlandhu for reporting the issue.
4.31.0¶
Implement providers’ lazy initialization.
Improve providers’ copying.
Improve typing in wiring module.
Fix wiring module loader uninstallation issue.
Fix provided instance providers error handing in asynchronous mode.
Fix overridden configuration option cache resetting. See issue: #428. Thanks to @dcendents for reporting the issue.
4.30.0¶
Remove restriction to wire a dynamic container.
4.29.2¶
Fix wiring to not crash on missing signatures. See issue: #420. Thanks to @Balthus1989 for reporting the issue.
4.29.1¶
Fix recursive copying issue in
Delegateprovider. See issue: #245. Thanks to @GitterRemote for reporting the issue.Add docs and example for
Factory.add_attributes()method.Remove legacy css file.
Remove
unittest2test dependency.
4.29.0¶
Implement context manager interface for resetting a singleton provider. See issue: #413. Thanks to @Arrowana for suggesting the improvement.
Implement overriding interface to container provider. See issue: #415. Thanks to @wackazong for bringing up the use case.
4.28.1¶
Fix async mode mode exception handling issue in
Dependencyprovider. See issue: #409. Thanks to @wackazong for reporting the issue.Fix links to
boto3example.
4.28.0¶
Add wiring injections into modules and class attributes. See issue: #411. Many thanks to @brunopereira27 for submitting the use case.
4.27.0¶
Introduce wiring inspect filter to filter out
flask.requestand other local proxy objects from the inspection. See issue: #408. Many thanks to @bvanfleet for reporting the issue and help in finding the root cause.Add
boto3example.Add tests for
.as_float()modifier usage with wiring.Make refactoring of wiring module and tests. See PR # #406. Thanks to @withshubh for the contribution: - Remove unused imports in tests. - Use literal syntax to create data structure in tests.
Add integration with a static analysis tool DeepSource.
4.26.0¶
Add wiring by string id.
Improve error message for
Dependencyprovider missing attribute.
4.25.1¶
Amend docs and add another example for
@containers.copy()decorator.
4.25.0¶
Add
application-multiple-containers-runtime-overridingexample. This example demonstrates how to build application from multiple containers and override one container config from another one in the runtime. See issue: #207.Add attributes forwarding for the
Dependencyprovider.
4.24.0¶
Add docs on
@containers.copy()decorator.Refactor
@containers.copy()decorator.Refactor async mode support in containers module.
4.23.5¶
Fix docs publishing.
4.23.4¶
Fix a typo.
4.23.3¶
Fix mistakenly processed awaitable objects in async mode. This bug has corrupted
fastapi-redisexample causing pool exhaustion. Thanks to @iliamir and Valery Komarov for finding and reporting the issue.Refactor async mode.
4.23.2¶
Improve async mode exceptions handling.
Fix double printing of exception when async resource initialization causes an error.
4.23.1¶
4.23.0¶
4.22.1¶
Pin
sphinxversion to hotfix docs build.Fix a typo in docs.
4.22.0¶
Add method
container.check_dependencies()to check if all container dependencies are defined. See issue: #383. Thanks to @shaunc for suggesting the feature.Add container name to the representation of the
Dependencyprovider.Add docs cross-links between
Singletonprovider and “Reset container singletons” pages.
4.21.0¶
Improve
Dependencyprovider error message: when dependency is undefined, error message contains its name.
4.20.2¶
Move docs on container “self” injections to “Providers” section.
4.20.1¶
Refactor containers module.
4.20.0¶
4.19.0¶
Add
singleton.full_reset()method to reset all underlying singleton providers.Fix
container.reset_singleton()to reset all provider types, not onlySingleton.Improve
container.traverse(types=[...])andprovider.traverse(types=[...])typing stubs to returntypes-typed iterator.Update docs on creating custom providers with a requirement to specify
.relatedproperty.
4.18.0¶
Add
container.reset_singleton()method to reset container singletons.Refactor
container.apply_container_providers_overridings()to usecontainer.traverse(). This enables deep lazy initialization ofContainerproviders.Add tests for
Selectorprovider.Add tests for
ProvidedInstanceandMethodCallerproviders.Update Makefile to make Python 3 tests to be a default test command:
make test.
4.17.0¶
Add
FastAPI+SQLAlchemyexample. Thanks to @ShvetsovYura for providing initial example: FastAPI_DI_SqlAlchemy.
4.16.0¶
Add container base class
containers.Container.DynamicContainerandDeclarativeContainerbecome subclasses of theContainer. See issue: #386. Thanks to @ventaquil for reporting the issue.
4.15.0¶
Add
Configuration.from_pydantic()method to load configuration from apydanticsettings.
4.14.0¶
Add container providers traversal.
Fix an issue with
container.init_resource()andcontainer.shutdown_resource()ignoring nested resources that are not present on the root level. See issue: #380. Thanks to @approxit for finding and reporting the issue.Add
.providesattribute toSingletonand its subclasses. It’s a consistency change to makeSingletonmatchCallableandFactoryinterfaces.Add
.initializerattribute toResourceprovider.Update string representation of
Resourceprovider.
4.13.2¶
Fix PyCharm typing warning “Expected type ‘Optional[Iterable[ModuleType]]’, got ‘List[module.py]’ instead” in
container.wire()method.
4.13.1¶
Fix declarative container metaclass bug: parent container providers replaced child container providers. See issue: #367. Many thanks to Shaun Cutts for finding and report the issue.
4.13.0¶
Add
defaultargument to the dependency provider:Dependency(..., default=...). See issue: #336. Many thanks to Shaun Cutts for providing the use case.
4.12.0¶
Add wiring import hook that auto-wires dynamically imported modules. See issue: #365. Thanks to @Balthus1989 for providing a use case.
4.11.3¶
Replace weakrefs with normal refs in
ConfigurationOptionto supportContainer().provider()use case. Test that it does not introduce a memory leak. See issue: #358#issuecomment-764482059. Many thanks to @Minitour for reporting the issue.
4.11.2¶
4.11.1¶
Fix a bug in
@containers.copyto improve replacing of subcontainer providers. See issue #378. Many thanks to Shaun Cutts for reporting the issue.
4.11.0¶
Add
loaderargument to the configuration providerConfiguration.from_yaml(..., loader=...)to override the default YAML loader. Many thanks to Stefano Frazzetto for suggesting an improvement.Make security improvement: change default YAML loader to the custom
yaml.SafeLoaderwith a support of environment variables interpolation. Many thanks to Stefano Frazzetto for suggesting an improvement.Update configuration provider
.from_*()methods to raise an exception in strict mode if configuration file does not exist or configuration data is undefined. Many thanks to Stefano Frazzetto for suggesting an improvement.Add
requiredargument to the configuration provider.from_*()methods to specify mandatory configuration sources. Many thanks to Stefano Frazzetto for suggesting an improvement.Fix a bug with asynchronous injections: async providers do not work with async dependencies. See issue: #368. Thanks @kolypto for the bug report.
Refactor asynchronous injections.
Add extra tests for asynchronous injections.
Migrate CI to Github Actions.
4.10.3¶
Fix a bug in the
Configurationprovider: strict mode didn’t work when provider is overridden byNone. See issue: #358#issuecomment-761607432. Many thanks to Stefano Frazzetto for reporting the issue.
4.10.2¶
4.10.1¶
Fix a Python 3.9 specific bug in
wiringmodule: introspection doesn’t work for builtintypes.GenericAlias. This resulted in wiring failure for modules importingqueue.Queue. See issue #362. Thanks @ventaquil for the bug report.Switch Coveralls reporting Travis Job to run on Python 3.9.
4.10.0¶
4.9.1¶
Fix a bug in the
Configurationprovider to correctly handle undefined values. See issue #358. Many thanks to Stefano Frazzetto for reporting the issue.
4.9.0¶
Add
.dependenciesattribute to theDeclarativeContainerandDynamicContainer. It returns dictionary of containerDependencyandDependenciesContainerproviders. See issue #357. Many thanks to Shaun Cutts for suggesting the feature.
4.8.3¶
Fix a bug in the
Configurationprovider to correctly handle overriding byNone. See issue #358. Many thanks to Stefano Frazzetto for reporting the issue.
4.8.2¶
Fix
Containerprovider to apply context overridings on root container initialization. See issue #354. Many thanks to Shaun Cutts for submitting the issue.Hotfix for version
4.8.0: fix side effect inContainerprovider overriding.
4.8.1¶
Fix declarative container multi-level inheritance issue. See issue #350. Many thanks to Shaun Cutts for submitting the issue.
4.8.0¶
Add support of overriding
Containerprovider. See issue #354. Many thanks to Shaun Cutts for submitting the issue.
4.7.0¶
Add container injection support for wiring.
4.6.1¶
Add Disqus comments widget to the provider’s async injections docs page.
4.6.0¶
Add support of async injections for providers.
Add support of async injections for wiring.
Add support of async initializers for
Resourceprovider.Add
FastAPI+Redisexample.Add ARM wheel builds. See issue #342 for details.
Fix a typo in ext.flask deprecation warning. See PR #345 for details. Thanks to Fotis Koutoupas for the fix.
Update copyright year.
4.5.4¶
Fix manylinux wheels uploading issue. See issue #333 for details. Thanks to Richard Jones for reporting the issue.
4.5.3¶
Fix
4.5.2degradation bug in wiring@injectwith not workingFastAPI.Dependsdirective. See issue #331 for details. Thanks to Juan Esteban Marín for reporting the issue.Add
FastAPItests.
4.5.2¶
Fix a bug in wiring
@injectwith not properly workingFastAPI.Dependsdirective. See issue #330 for details. Thanks to Lojka-oops for reporting the issue.
4.5.1¶
Fix flake8 issue in
Commands and Handlersexample.
4.5.0¶
Add support of non-string keys for
Dictprovider.Add simple
FastAPIexample.Add
Commands and Handlersexample from issue #327.Add extra typing test for provided instance of
DependenciesContainerprovider.
4.4.1¶
Improve
FastAPIintegration: handleDepends(Provide[...]).Update
FastAPIexample.Remove a typo from the
Flasktutorial.
4.4.0¶
Add
@injectdecorator. It helps to fix a number of wiring bugs and make wiring be more resilient.Refactor
wiringmodule.Update documentation and examples to use
@injectdecorator.Add
Flaskblueprints example.Fix wiring bug when wiring doesn’t work with the class-based decorators.
Fix wiring bug when wiring doesn’t work with the decorators that doesn’t use
functools.wraps(...).Fix wiring bug with
@app.route(...)-style decorators (Flask, Sanic, FastAPI, etc.).Fix wiring bug when wiring doesn’t work with Flask blueprints.
4.3.9¶
Add
FastAPIexample.
4.3.8¶
Add a hotfix to support wiring for
FastAPIendpoints.
4.3.7¶
Fix race in
ThreadSafeSingleton. Many thanks to Dmitry Rassoshenko aka rda-dev for the pull request (See PR #322).
4.3.6¶
Fix changelog typo.
4.3.5¶
Fix a bug in
wiringmodule that caused multiple imports of the modules when.wire(packages=[...])is used (See issue #320). Thanks to Federico iskorini for reporting the issue.
4.3.4¶
Fix a bug in
Configurationprovider that resulted in not working.reset_override()(See issue #319). Thanks to Jun lust4life for reporting the issue and suggesting a fix.
4.3.3¶
Fix a bug in
wiringwith improper patching of@classmethodand@staticmethoddecorated methods (See issue #318).
4.3.2¶
Fix a bug in
wiringwith mistakenly initialized and shutdown resource withClosingmarker on context argument providing.
4.3.1¶
Fix README.
4.3.0¶
Implement per-function execution scope for
Resourceprovider in tandem withwiring.Closing.
4.2.0¶
Add support of Python 3.9.
Update readme.
4.1.8¶
Update asyncio daemon, single- and multi-container examples to use
Resourceprovider.
4.1.7¶
Add CI job to build and push documentation to S3 bucket.
4.1.6¶
4.1.5¶
Fix Travis CI windows and MacOS builds.
4.1.4¶
Fix version of
cibuildwheel==1.63.Update Travis CI webhooks to fix builds triggering.
4.1.3¶
Migrate from
travis-ci.orgtotravis-ci.comto fix build issues.Add explicit installation of
certififor Windows build to resolve build problems.
4.1.2¶
Bump version of
cibuildwheel>=1.5.1to resolve Windows build problem.
4.1.1¶
Fix a few typos in
Resourceprovider docs.
4.1.0¶
Add
Resourceprovider.Add
Dictprovider.“Un-deprecate”
@containers.override()and@containers.copy()decorators ( see Issue 301 for more information).Add favicon.
Remove redirects that occur while getting badge images to optimize docs load speed.
Update license year.
Update short description on PyPI.
4.0.6¶
Fix wiring for top-level package
__init__.py.
4.0.5¶
Move
.providedattribute toproviders.Provider.Update all links in documentation and examples to use
https://instead ofhttp.
4.0.4¶
Fix typing stubs for
container.override()method.
4.0.3¶
Deprecate
@containers.override()and@containers.copy()decorators.Update changelog of version
4.0.0so it lists all deprecated features.
4.0.2¶
4.0.1¶
4.0.0¶
New features:
Add
wiringfeature.
Deprecations:
Deprecate
ext.aiohttpmodule in favor ofwiringfeature.Deprecate
ext.flaskmodule in favor ofwiringfeature.Deprecate
.delegate()provider method in favor of.providerattribute.
Removals:
Remove deprecated
typesmodule.
Tutorials:
Update
flasktutorial.Update
aiohttptutorial.Update
asynciodaemon tutorial.Update CLI application tutorial.
Examples:
Add
djangoexample.Add
sanicexample.Update
aiohttpexample.Update
flaskexample.Update
asynciodaemon example.Update
movie-listerexample.Update CLI application example.
Misc:
Regenerate C sources using Cython 0.29.21.
Improve documentation and README (typos removal, rewording, etc).
3.44.0¶
Add native support of the generics to the providers:
some_provider = providers.Provider[SomeClass].Deprecate module
types.Add documentation page on providers typing and
mypysupport.Update README.
3.43.1¶
Fix a typo in README.
3.43.0¶
Update API documentation.
Remove not relevant “speech” example.
Fix a few typos.
3.42.0¶
Update “DI in Python” documentation page.
Delete “What is DI?” documentation page.
Delete “engines cars” example mini app.
Update README.
3.41.0¶
Refactor “use cases” example.
Refactor “password hashing” example.
Refactor “chained factories” pattern example.
Refactor “factory of factories” pattern example.
Fix declarative container mypy stub to
__init__to accept not only providers.Refactor main module of the “decoupled packages” example.
Delete “api client” example mini app.
Delete “mail service” example mini app.
3.40.0¶
Add “Decoupled packages” example.
Delete “Bundles” examples mini application.
3.39.0¶
Add application examples with single and multiple containers.
Remove “Services” application examples.
Split examples page into “Examples” with main examples and “Other Examples” with secondary examples.
Move “Installation” page to “Introduction” section.
3.38.1¶
Fix README.
3.38.0¶
Update “What is What is dependency injection?” documentation page.
Update README.
Fix a bunch of typos.
3.37.0¶
Update index documentation page.
Make multiple improvements and fixes for the providers documentation.
Update “Key Features” documentation page.
Remove “Structure of Dependency Injector” documentation page.
Edit “Feedback” documentation page.
3.36.0¶
Update providers overriding documentation and rework examples.
Update documentation on injecting provided object attributes, items or method calls.
Update documentation and example on creating a custom provider.
Update providers index documentation page to give better overview of providers functionality.
Fix mypy stub of the
Providerto specify the protected._copy_overridings()method.Update copyright year in the documentation.
3.35.1¶
Fix minor issues in the providers documentation and examples.
3.35.0¶
Update documentation and rework examples for:
Singleton,Callable,Coroutine,Object,List,Configuration,Selector, andDependencyproviders.Fix mypy stub of the
DeclarativeContainerto specify the__init__interface.
3.34.0¶
Update
Factoryprovider documentation.Rework
Factoryprovider examples.
3.33.0¶
Add typing stubs.
3.32.3¶
Fix few typos on README and docs main pages.
3.32.2¶
Make a fix in the factory delegation example (thanks to Joël Bourgault for finding and reporting the issue).
3.32.1¶
Update DI Demo 2 example and READ to make typed configuration option injection.
3.32.0¶
Add a feature that helps to explicitly specify the type of the configuration option value before the injection.
Add disqus comments to the docs page on injecting provided instance attributes, items, etc.
3.31.0¶
3.30.4¶
Update README.
3.30.3¶
Update README.
Update containers documentation and examples.
3.30.2¶
Update README.
3.30.1¶
Update README.
Add one more example.
3.30.0¶
Rework
Movie Listerexample.Add tutorial for building
Movie Lister.Make some rewording for the other tutorials.
Fix a couple of typos.
3.29.0¶
Update README with the more direct message on what is
Dependency Injectorand how is it different from the other frameworks.Change the example code in the README.
Add FAQ to the README.
Update documentation key features and index pages.
3.28.1¶
Fix typos in the
asyncio+Dependency Injectormonitoring daemon tutorial.
3.28.0¶
Add
asyncio+Dependency Injectorexamplemonitoring-daemon-asyncio.Add
asyncio+Dependency Injectormonitoring daemon tutorial.Fix a typo in the docblock of the
Configurationprovider.Fix multiple typos in the
flaskandaiohttptutorials.Fix
Makefileto runaiohttpintegration tests on Python 3.5+.
3.27.0¶
Add deep init injections overriding for
Factoryprovider.Add
asynciomonitoring daemon example.
3.26.0¶
Add configuration itemselector feature (see Issue 274).
Re-design
Configurationprovider implementation.Update
giphynav-aiohttpto remove doubled “if not query” (many thanks to Oleg Baranov for the feedback).
3.25.1¶
Fix
aiohttptutorial typos.
3.25.0¶
Add
aiohttptutorial.Fix
Flasktutorial typos and change some wording.
3.24.1¶
Update Google Search Console verification meta tag.
Update meta description.
3.24.0¶
Add
Aiohttpintegration moduledependency_injector.ext.aiohttp.Add
Aiohttp+Dependency Injectorexamplegiphynav-aiohttp.
3.23.2¶
Fix
Flasktutorial code issues, typos and change some wording.
3.23.1¶
Fix an issue with creating
Dependencyprovider withabc.ABCMeta. Thanks to awaizman1. More info: Issue #266, PR #267.
3.23.0¶
Add
Flasktutorial.Add PyPI classifiers.
3.22.0¶
Migrate docs to
alabastertheme.Add
Bootstrapextension to theghnav-flaskexample.Add stubs for the tutorials to the docs.
3.21.2¶
Hotfix changelog typo.
3.21.1¶
Hotfix
ghnav-flaskexample to read Github token from environment variable.
3.21.0¶
Re-design
Flaskintegration.Make cosmetic fixes for
Selectorprovider docs.
3.20.1¶
Hotfix Windows builds.
3.20.0¶
Add
Flaskintegration moduledependency_injector.ext.flask.Add
Flask+Dependency Injectorexampleghnav-flask.Add
Factory.providesattribute. It is an alias to theFactory.cls.New README.
3.19.2¶
Add logo.
3.19.1¶
Start distributing wheels for Linux, MacOS, and Windows (thanks to Travis CI and cibuildwheel).
Start using
twinefor publishing package on PyPI.Fix Travis CI configuration file warnings.
3.19.0¶
Add
Selectorprovider.Fix
Configuration.override()to returnOverridingContextfor non-dictionary values.
3.18.1¶
Add interpolation of environment variables to
Configuration.from_yaml()andConfiguration.from_ini().Add ignoring of
IOErrortoConfiguration.from_yaml().
3.18.0¶
Add
Configuration.from_yaml()method to load configuration from the yaml file.Add
Configuration.from_ini()method to load configuration from the ini file.Add
Configuration.from_dict()method to load configuration from the dictionary.Add
Configuration.from_env()method to load configuration from the environment variable.Add default value for
nameargument ofConfigurationprovider.Add documentation for
Configurationprovider.Remove undocumented positional parameter of
DependenciesContainerprovider.
3.17.1¶
Fix
DynamicContainerdeep-copying bug.
3.17.0¶
Add
Containerprovider.Add
Configurationproviders linking.
3.16.1¶
Update
singleton_thread_locals.pyto support Python 3 (thanks to RobinsonMa, PR #252).Fix Disqus comments.
Fix warnings in API docs.
3.16.0¶
Add
Listprovider issue #243, PR #251.Fix a few typos in docs (thanks to Bruno P. Kinoshita, issue #249, PR #250).
Add support of six 1.15.0.
Regenerate C sources using Cython 0.29.20.
3.15.6¶
Fix changelog typo.
3.15.5¶
Add downloads badge.
3.15.4¶
Update a link to the PyPi page on the README page.
3.15.3¶
Fix a typo in the link to the PyPi on the “Dependency Injection in Python” documentation page.
Fix a couple of typos in the list of key features on the “Key Features” and index documentation pages.
Update a link to the PyPi page on a couple of documentation pages.
3.15.2¶
Fix a typo in the installation instructions on the README page and in the documentation.
3.15.1¶
Fix a couple of typos in the README.
Fix a couple of types in the diagram of “Engines-Cars” example.
3.15.0¶
Add Python 3.8 support.
Add PyPy 3.6 support.
Add support of six 1.14.0.
Add support of six 1.13.0.
Regenerate C sources using Cython 0.29.14.
Remove Python 2-ish inheritance from
objectin example modules.Replace Python 2-ish
super(class, self).__init__()calls with Python 3-ishsuper().__init__()in example modules.Fix doc block errors in example modules, including related to PEP257-compliance.
Clean up tox.ini file.
3.14.12¶
Fix
3.14.11degradation issue causing inability of usingDelegateprovider inDeclarativeContainerwhen this container is instantiated with overriding of delegating provider (thanks to GitterRemote, issue details are here #235).
3.14.11¶
3.14.10¶
Make spelling fix for the list of contributors.
3.14.9¶
Improve README - minor English nitpicking (thanks to supakeen).
3.14.8¶
Regenerate C sources using Cython 0.29.13.
3.14.7¶
Fix typo on “Dependency injection and inversion of control in Python” docs page (thanks to Dmitry (xotonic)).
3.14.6¶
Fix
FactoryAggregateprovider copying issue.Regenerate C sources using Cython 0.29.7.
3.14.5¶
Fix issue causing
ThreadLocalSingletonprovider to returnNoneafter reset (thanks to Jeroen Rietveld).Add test for
ThreadLocalSingletonprovider reset functionality (thanks to Jeroen Rietveld).Regenerate C sources using Cython 0.29.6.
3.14.4¶
Fix typo in providers doc (thanks to Vlad Ghita).
3.14.3¶
Fix issue with copying providers that have system streams injections (
sys.stdin,sys.stdoutandsys.stderr).Add support of six 1.12.0.
Regenerate C sources using Cython 0.29.2.
3.14.2¶
Set Cython
language_level=2.
3.14.1¶
Fix bug #208: version
3.14.0hasn’t worked on Python 3.5.2 (thanks to Jeroen Entjes).Remove deprecated
assertEqualsfrom tests.Regenerate C sources using Cython 0.29.
3.14.0¶
Add
Coroutineprovider.Add
DelegatedCoroutineprovider.Add
AbstractCoroutineprovider.Add
CoroutineDelegateprovider.Fix type-hinting of
*args&**kwargsthat was specified in doc blocks of various providers and caused inspection problems in PyCharm.Regenerate C sources using Cython 0.28.5.
3.13.2¶
Add additional benchmark of
Factoryprovider.Add tests and tox.ini to the distribution, so that they could be used after package is installed (thanks to Tobias Happ).
3.13.1¶
Fix typo on “Chained Factories” pattern docs page.
3.13.0¶
Add Python 3.7 support.
Drop Python 3.3 support.
Drop Python 2.6 support.
Add example of “Chained Factories” pattern.
Add example of “Factory of Factories” pattern.
3.12.4¶
3.12.3¶
Fix bug #198.
Regenerate C sources using Cython 0.28.4.
3.12.2¶
Apply code style fixes to “services_v2” example miniapp.
3.12.1¶
Update main page example from “services_v1” to “services_v2”.
Fix few typos on main page.
Add new example miniapp “password_hashing”.
Add new example miniapp “services_v2”.
Rename example miniapp “services” to “services_v1”.
Fix incompatibility issue between Python 3.3, pip 10.0.0 and virtualenv 16.0.0 (details) that caused failures of Python 3.3 tests on Travis.
Regenerate C sources using Cython 0.28.3.
3.12.0¶
Regenerate C sources using Cython 0.28.2.
3.11.3¶
Fix padding problem in code samples in docs.
3.11.2¶
Fix padding problem in code samples in docs.
Remove
autodocfrom the list of documentation dependencies.
3.11.1¶
Fix small typo in documentation (thanks to James Lafa).
3.11.0¶
Improve
Configurationprovider overriding logic.Refactor
Configurationprovider.Improve
DependenciesContainerprovider overriding logic.Update “services” example miniapp.
Update “bundles” example miniapp.
3.10.0¶
Add
DependenciesContainerprovider.Add “use_cases” example miniapp.
Update documentation requirements to use fixed version of
sphinxcontrib-disqus.
3.9.1¶
Fix docs build problem (
sphinxis frozen on1.5.6version because of incompatibility withsphinxcontrib-discus).Add badge for docs.
3.9.0¶
Change initialization of declarative container, so it accepts overriding providers as keyword arguments -
DeclarativeContainer(**overriding_providers).Add method to dynamic catalog for setting groups of providers -
DynamicContainer.set_providers(**providers).Add method to dynamic catalog for overriding groups of providers -
DynamicContainer.set_providers(**overriding_providers).Rename
ExternalDependencyprovider toDependency.Add default value for
instance_ofargument ofDependencyprovider -Dependency(instance_of=object).Fix bug when copying
Configurationprovider.Regenerate C sources using Cython 0.27.3.
Add “bundles” example miniapp.
3.8.2¶
Fix padding problem in code samples in docs (part 2).
3.8.1¶
Fix padding problem in code samples in docs.
3.8.0¶
Add
DeclarativeContainer.containersattribute that stores dictionary of nested containers.Fix bug related to double-overridden providers (provider1 -> provider2 -> provider3).
3.7.1¶
Add support of six 1.11.0.
3.7.0¶
Add
FactoryAggregateprovider.Add
Provider.providerdynamic attribute that return new provider’s delegate (alias of methodProvider.delegate()).Add support of six 1.11.0.
Regenerate C sources using Cython 0.27.1.
3.6.1¶
Regenerate C sources using Cython 0.26.
3.6.0¶
Add
CallableDelegateprovider.Add
FactoryDelegateprovider.Add
SingletonDelegateprovider.
3.5.0¶
Add functionality for initializing
Configurationprovider with default values.
3.4.8¶
Code style fixes in
providersmodule.
3.4.7¶
Correct typo in changelog.
3.4.6¶
Add “Useful links” section to the “Dependency injection and inversion of control in Python” article.
3.4.5¶
Remove non-ascii character from README. This character created an installation problem on Debian (Python 3.4).
3.4.4¶
Add
Provider.last_overridingread-only property that points to last overriding provider, if any. If target provider is not overridden,Nonewould be returned.Update example of writing custom providers.
Update movie lister example miniapp.
Update source of
coveralls.iobadge.
3.4.3¶
Update doc block for
Provider.overriding_lockattribute.
3.4.2¶
Make
Provideroverriding methods thread safe:Provider.override(provider),Provider.reset_last_overriding(),Provider.reset_override().Refactor storage locking of
ThreadSafeSingletonprovider.Fix few
pydocstyleerrors in examples.
3.4.1¶
Update movie lister example miniapp with
AbstractFactoryprovider.
3.4.0¶
Add
AbstractCallableprovider.Add
AbstractFactoryprovider.Add
AbstractSingletonprovider.Optimize calling of overridden providers (~15% faster).
3.3.7¶
Fix minor bug related to patch of
Configurationprovider in version 3.3.6 - special attributes were identified by formula__{text}- now they are identified by formula__{text}__, that is more correct according to Python Data Model.
3.3.6¶
Patch
Configurationprovider to raiseAttributeErrorwhen there is an attempt to access special attribute like__module__or__name__(this behaviour is identical to behaviour ofobject).Apply minor refactoring for
providersmodule.Remove cythonization from travis building process.
3.3.5¶
[Refactoring] Consolidate all containers in
dependency_injector.containersmodule.[Refactoring] Consolidate all providers in
dependency_injector.providersmodule.
3.3.4¶
Change
__module__attribute for all members ofdependency_injector.containerspackage to point to package, but not to package modules.Regenerate C sources using Cython 0.25.2.
3.3.3¶
Update services miniapp example.
3.3.2¶
Add disqus.com comments for documentation.
Fix reference to version in api docs.
Fix title underline in containers api docs.
Update documentation copyright year.
Update example version in installation document.
3.3.1¶
Add some improvements to the documentation.
3.3.0¶
Add support of Python 3.6.
3.2.5¶
Add description of structure into README.
Fix documentation errors.
3.2.4¶
Switch to single version of documentation for getting shorter urls (without
/en/stable/). Add appropriate redirects for compatibility with previous links.Update copyright date.
3.2.3¶
Add examples into README.
Make minor documentation updates.
3.2.2¶
Change name of version variable to follow PEP8:
VERSION->__version__.
3.2.1¶
Update
servicesminiapp example.
3.2.0¶
Add
Configurationprovider for late static binding of configuration options.
3.1.5¶
Refactor provider internals: C functions naming scheme and code layout.
Add Terrence Brannon (metaperl) to the list of contributors.
3.1.4¶
Move
inlinefunctions from class level to module level for removing them from virtual table and enable inlining.
3.1.3¶
Fix flake8
E305error in examples.
3.1.2¶
Remove
public(extern) modifier utils constants.Fix flake8
E305error in examples.
3.1.1¶
Fix minor typo in README.
3.1.0¶
Add “Services mini application” example.
Fix minor error in
Factoryprovider API doc.
3.0.1¶
Add
*.csource files under version control.Change keywords.
3.0.0¶
Providers
All providers from
dependency_injector.providerspackage are implemented as C extension types using Cython.Add
BaseSingletonsuper class for all singleton providers.Make
Singletonprovider not thread-safe. It makes performance ofSingletonprovider 10x times faster.Add
ThreadSafeSingletonprovider - thread-safe version ofSingletonprovider.Add
ThreadLocalSingletonprovider -Singletonprovider that uses thread-local storage.Remove
providesattribute fromFactoryandSingletonproviders.Add
set_args()andclear_args()methods forCallable,FactoryandSingletonproviders.
Containers
Module
dependency_injector.containerswas split into submodules without any functional changes.
Utils
Module
dependency_injector.utilsis split intodependency_injector.containersanddependency_injector.providers.
Miscellaneous
Remove
@injectdecorator.Add makefile (
clean,test,build,install,uninstall&publishcommands).Update repository structure:
Sources are moved under
src/folder.Tests are moved under
tests/unit/folder.
2.2.10¶
Fix typo in README.
2.2.9¶
Add github badges to readme and docs index pages.
Update service names in services example miniapp.
Create engines & cars example miniapp.
2.2.8¶
Move fixtures to separate module in movie lister example.
2.2.7¶
Fix typo in README.
2.2.6¶
Update README.
Update docs index page.
2.2.5¶
Fix typo in README.
2.2.4¶
Update README.
2.2.3¶
Update README.
2.2.2¶
Update README.
2.2.1¶
Update examples.
2.2.0¶
Deprecate
injectdecorator.
2.1.1¶
Normalize package names by PEP-503.
2.1.0¶
Add
ThreadLocalSingletonandDelegatedThreadLocalSingletonproviders.Add documentation section about singleton providers and multi-threading.
Update API docs of creational providers.
2.0.0¶
Introduce new injections style for
Callable,Factory&Singletonproviders.Drop providers:
Static,Value,Function,Class,Config.Increase performance of making injections in 2 times (+100%).
Drop method injections.
Simplify providers overriding system.
Replace
catalogspackage withcontainersmodule.Drop all backward compatibilities for 1.x.
Refactor most of the components.
Update documentation.
1.17.0¶
Add
add_injections()method toCallable,DelegatedCallable,Factory,DelegatedFactory,SingletonandDelegatedSingletonproviders.Fix bug with accessing to declarative catalog attributes from instance level.
1.16.8¶
Fix some typos in introduction section of documentation.
1.16.7¶
Add some changes into introduction section of documentation.
1.16.5¶
Move project to
https://github.com/ets-labs/python-dependency-injector.Move project docs to
http://python-dependency-injector.ets-labs.org/.
1.16.4¶
Add some documentation improvements.
1.16.1¶
Add
@copydecorator for copying declarative catalog providers.Add line numbers for all code samples in documentation.
Add “Examples” section into documentation.
Add “Movie Lister” example.
Add “Services” example.
Move project documentation into organisation’s domain (dependency-injector.ets-labs.org).
1.15.2¶
[Refactoring] split
catalogsmodule into smaller modules,catalogsmodule become a package.[Refactoring] split
providersmodule into smaller modules,providersmodule become a package.Update introduction documentation.
1.15.1¶
Update package information and documentation.
1.15.0¶
Add
Provider.provide()method.Provider.__call__()become a reference toProvider.provide().Add provider overriding context.
Update main examples and README.
1.14.11¶
Update README.
1.14.10¶
Add “catalog-providing-callbacks” example and several tests for it.
1.14.9¶
Add
overridedecorator in providers module.Add storing of originally decorated instance in
injectdecorator.Add several refactorings.
Switch to
pydocstyletool frompep257.
1.14.8¶
Update README.
1.14.7¶
Add one more example in README (inline providers and injections).
1.14.6¶
Add
clsalias forprovidesattributes ofFactory,DelegatedFactory,SingletonandDelegatedSingletonproviders.
1.14.5¶
Fix typo in provider’s error message.
1.14.4¶
Update documentation.
1.14.3¶
Optimize internals of providers.
Optimize
Callableprovider.Optimize
Factoryprovider.Optimize
Singletonprovider.
1.14.2¶
Update documentation and description.
1.14.1¶
Add meta description & keywords on docs index page.
1.14.0¶
Drop support of Python 3.2.
1.13.2¶
Update PyPi info.
1.13.1¶
Transfer ownership to ETS Labs.
1.13.0¶
Add
DelegatedCallableprovider.Add
DelegatedFactoryprovider.Add
DelegatedSingletonprovider.Add some documentation improvements.
1.12.0¶
Add possibility to specialize
Factoryprovided type.Add possibility to specialize
Singletonprovided type.Add possibility to specialize
DeclarativeCatalogprovider type.Add possibility to specialize
DynamicCatalogprovider type.Make some refactorings for providers.
1.11.2¶
Improve representation of providers and injections.
1.11.1¶
Previous state of Dependency Injector framework (0.11.0 version) is considered to be production ready / stable, so current release is considered to be the first major release.
Increase major version.
Backward compatibility with all previous versions above 0.7.6 has been saved.
0.11.0¶
Rename
AbstractCatalogtoDeclarativeCatalog(with backward compatibility).Rename
catalogmodule tocatalogswith backward compatibility.Implement dynamic binding of providers for
DeclarativeCatalog.Add
DynamicCatalog.Change restrictions for providers-to-catalogs bindings - provider could be bound to several catalogs with different names.
Restrict overriding of providers by themselves.
Restrict overriding of catalogs by themselves.
Make
DeclarativeCatalog.last_overridingattribute to beNoneby default.Make
Provider.last_overridingattribute to beNoneby default.Refactor catalogs and providers modules.
Add API documentation
Improve user’s guides and examples.
0.10.5¶
Add more representable implementation for
AbstractCatalogandAbstractCatalog.Bundle.
0.10.4¶
Remove VERSION file from MANIFEST.in.
0.10.3¶
Update example docblocks.
0.10.2¶
Fix bug with injecting entities that implement
__getattr__.
0.10.1¶
Update some examples.
0.10.0¶
Add functionality for creating
AbstractCatalogprovider bundles.Improve
AbstractCataloginheritance.Improve
AbstractCatalogoverriding.Add images for catalog “Writing catalogs” and “Operating with catalogs” examples.
Add functionality for using positional argument injections with
Factory,Singleton,Callableproviders andinjectdecorator.Add functionality for decorating classes with
@inject.Add
Singleton.injectionsattribute that represents a tuple of allSingletoninjections (including args, kwargs, attributes and methods).Add
Callable.injectionsattribute that represents a tuple of allCallableinjections (including args and kwargs).Add optimization for
Injection.valueproperty that will compute type of injection once, instead of doing this on every call.Add
VERSIONconstant for verification of currently installed version.Add support of Python 3.5.
Add support of six 1.10.0.
Add minor refactorings and code style fixes.
0.9.5¶
Change provider attributes scope to public.
Add
Factory.injectionsattribute that represents a tuple of allFactoryinjections (including kwargs, attributes and methods).
0.9.4¶
Add minor documentation fixes.
0.9.3¶
Implement thread safety.
0.9.2¶
Add minor refactorings.
0.9.1¶
Add simplified syntax of kwarg injections for
di.Factoryanddi.Singletonproviders:di.Factory(SomeClass, dependency1=injectable_provider_or_value).Add simplified syntax of kwarg injections for
di.Callableprovider:di.Callable(some_callable, dependency1=injectable_provider_or_value)Add simplified syntax of kwarg injections for
@di.injectdecorator:@di.inject(dependency1=injectable_provider_or_value).Optimize
@di.inject()decorations when they were made several times for the same callback.Add minor refactorings.
Fix of minor documentation issues.
0.8.1¶
Objectsis renamed toDependency Injector.
0.7.8¶
Fixing @inject import bug in examples.
0.7.7¶
Fixing minor bug in concept example.
0.7.6¶
Adding support of six from 1.7.0 to 1.9.0.
Factory / Singleton providers are free from restriction to operate with classes only. This feature gives a change to use factory method and functions with Factory / Singleton providers.
All attributes of all entities that have to be protected was renamed using
_protectedmanner.Providers extending was improved by implementing overriding logic in
Provider.__call__()and moving providing logic intoProvider._provide().NewInstanceprovider was renamed toFactoryprovider.NewInstancestill can be used, but it considered to be deprecated and will be removed in further releases.@injectdecorator was refactored to keep all injections in_injectionsattribute of decorated callback. It will give a possibility to track all the injections of particular callbacks and gives some performance boost due minimizing number of calls for doing injections.A lot of documentation updates were made.
A lot of examples were added.
Some minor refactorings were done.
Previous versions¶
While Objects was in alpha state, changes were not tracked.