Merge branch 'release/3.30.2' into master

This commit is contained in:
Roman Mogylatov 2020-08-13 22:57:51 -04:00
commit 88866d596b
3 changed files with 58 additions and 2 deletions

View File

@ -52,7 +52,59 @@ What is ``Dependency Injector``?
``Dependency Injector`` is a dependency injection framework for Python. ``Dependency Injector`` is a dependency injection framework for Python.
It provides you with the container and the providers that help you build your application objects: It helps you implement the dependency injection principle.
What is dependency injection?
-----------------------------
Dependency injection is a principle that helps to decrease coupling and increase cohesion. Your
code becomes more flexible, clear and it is easier to test it.
How to implement dependency injection?
--------------------------------------
Objects do not create each other anymore. They provide a way to inject the needed dependency
instead.
Before:
.. code-block:: python
class ApiClient:
def __init__(self):
self.api_key = os.getenv('API_KEY')
self.timeout = os.getenv('TIMEOUT')
class Service:
def __init__(self):
self.api_client = ApiClient()
After:
.. code-block:: python
class ApiClient:
def __init__(self, api_key: str, timeout: int):
self.api_key = api_key
self.timeout = timeout
class Service:
def __init__(self, api_client: ApiClient):
self.api_client = api_client
Who creates the objects now? Look at the next section.
What does Dependency Injector do?
---------------------------------
``Dependency Injector`` provides you with the container and the providers that help you build
your application objects when you apply dependency injection principle:
.. code-block:: python .. code-block:: python

View File

@ -7,6 +7,10 @@ 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`_
3.30.2
------
- Update README.
3.30.1 3.30.1
------ ------
- Update README. - Update README.

View File

@ -1,6 +1,6 @@
"""Dependency injector top-level package.""" """Dependency injector top-level package."""
__version__ = '3.30.1' __version__ = '3.30.2'
"""Version number that follows semantic versioning. """Version number that follows semantic versioning.
:type: str :type: str