Merge branch 'release/4.23.1' into master

This commit is contained in:
Roman Mogylatov 2021-02-15 18:13:21 -05:00
commit b2ea773c71
4 changed files with 15 additions and 3 deletions

View File

@ -7,6 +7,12 @@ 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.23.1
------
- Hotfix a bug with importing FastAPI ``Request``.
See issue: `#398 <https://github.com/ets-labs/python-dependency-injector/issues/398>`_.
Thanks to `@tapm <https://github.com/tapm>`_ for reporting the bug.
4.23.0 4.23.0
------ ------
- Add support of aliases for ``Configuration`` provider. - Add support of aliases for ``Configuration`` provider.

View File

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

View File

@ -345,8 +345,13 @@ def _unpatch(
def _fetch_reference_injections( def _fetch_reference_injections(
fn: Callable[..., Any], fn: Callable[..., Any],
) -> Tuple[Dict[str, Any], Dict[str, Any]]: ) -> Tuple[Dict[str, Any], Dict[str, Any]]:
# # Hotfix, see: https://github.com/ets-labs/python-dependency-injector/issues/362 # Hotfix, see:
if GenericAlias and fn is GenericAlias: # - https://github.com/ets-labs/python-dependency-injector/issues/362
# - https://github.com/ets-labs/python-dependency-injector/issues/398
if GenericAlias and any((
fn is GenericAlias,
getattr(fn, '__func__', None) is GenericAlias
)):
fn = fn.__init__ fn = fn.__init__
signature = inspect.signature(fn) signature = inspect.signature(fn)

View File

@ -1,6 +1,7 @@
import sys import sys
from fastapi import FastAPI, Depends from fastapi import FastAPI, Depends
from fastapi import Request # See: https://github.com/ets-labs/python-dependency-injector/issues/398
from fastapi.security import HTTPBasic, HTTPBasicCredentials from fastapi.security import HTTPBasic, HTTPBasicCredentials
from dependency_injector import containers, providers from dependency_injector import containers, providers
from dependency_injector.wiring import inject, Provide from dependency_injector.wiring import inject, Provide