Merge branch 'release/4.0.3' into master

This commit is contained in:
Roman Mogylatov 2020-10-16 21:44:27 -04:00
commit 4e5083693d
4 changed files with 1289 additions and 1134 deletions

View File

@ -7,6 +7,11 @@ that were made in every particular version.
From version 0.7.6 *Dependency Injector* framework strictly From version 0.7.6 *Dependency Injector* framework strictly
follows `Semantic versioning`_ follows `Semantic versioning`_
4.0.3
-----
- Deprecate ``@containers.override()`` and ``@containers.copy()`` decorators.
- Update changelog of version ``4.0.0`` so it lists all deprecated features.
4.0.2 4.0.2
----- -----
- Fix typing stubs for ``@container.override()`` and ``@containers.copy()`` decorators ( - Fix typing stubs for ``@container.override()`` and ``@containers.copy()`` decorators (
@ -33,6 +38,8 @@ Deprecations:
- Deprecate ``ext.aiohttp`` module in favor of ``wiring`` feature. - Deprecate ``ext.aiohttp`` module in favor of ``wiring`` feature.
- Deprecate ``ext.flask`` module in favor of ``wiring`` feature. - Deprecate ``ext.flask`` module in favor of ``wiring`` feature.
- Deprecate ``.delegate()`` provider method in favor of ``.provider`` attribute. - Deprecate ``.delegate()`` provider method in favor of ``.provider`` attribute.
- Deprecate ``@containers.override()`` decorator in favor of overriding container on instance level.
- Deprecate ``@containers.copy()`` decorator.
Removals: Removals:

View File

@ -1,6 +1,6 @@
"""Top-level package.""" """Top-level package."""
__version__ = '4.0.2' __version__ = '4.0.3'
"""Version number. """Version number.
:type: str :type: str

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
"""Containers module.""" """Containers module."""
import sys import sys
import warnings
import six import six
@ -427,6 +428,11 @@ def override(object container):
:return: Declarative container's overriding decorator. :return: Declarative container's overriding decorator.
:rtype: callable(:py:class:`DeclarativeContainer`) :rtype: callable(:py:class:`DeclarativeContainer`)
""" """
warnings.warn(
'Decorator "@override()" is deprecated since version 4.0.3. '
'Use overriding on instance level instead "container.override(AnotherContainer())".',
category=DeprecationWarning,
)
def _decorator(object overriding_container): def _decorator(object overriding_container):
"""Overriding decorator.""" """Overriding decorator."""
container.override(overriding_container) container.override(overriding_container)
@ -447,6 +453,10 @@ def copy(object container):
:return: Declarative container's copying decorator. :return: Declarative container's copying decorator.
:rtype: callable(:py:class:`DeclarativeContainer`) :rtype: callable(:py:class:`DeclarativeContainer`)
""" """
warnings.warn(
'Decorator "@copy()" is deprecated since version 4.0.3.',
category=DeprecationWarning,
)
def _decorator(copied_container): def _decorator(copied_container):
cdef dict memo = dict() cdef dict memo = dict()
for name, provider in six.iteritems(copied_container.cls_providers): for name, provider in six.iteritems(copied_container.cls_providers):