Merge branch 'release/3.15.1' into master

This commit is contained in:
Roman Mogylatov 2020-01-26 19:17:46 -05:00
commit 363b87fd74
4 changed files with 31 additions and 26 deletions

View File

@ -60,6 +60,21 @@ Status
| | :alt: Github forks | | | :alt: Github forks |
+---------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +---------------------------------------+--------------------------------------------------------------------------------------------------------------------+
Installation
------------
The *Dependency Injector* library is available on `PyPi`_::
pip install dependency_injector
Documentation
-------------
The *Dependency Injector* documentation is hosted on ReadTheDocs:
- `User's guide`_
- `API docs`_
Dependency injection Dependency injection
-------------------- --------------------
@ -122,7 +137,7 @@ Listing of ``example.engines`` module:
"""Dependency injection example, engines module.""" """Dependency injection example, engines module."""
class Engine(object): class Engine:
"""Example engine base class. """Example engine base class.
Engine is a heart of every car. Engine is a very common term and could be Engine is a heart of every car. Engine is a very common term and could be
@ -138,8 +153,8 @@ Listing of ``example.engines`` module:
"""Diesel engine.""" """Diesel engine."""
class ElectroEngine(Engine): class ElectricEngine(Engine):
"""Electro engine.""" """Electric engine."""
Listing of ``example.cars`` module: Listing of ``example.cars`` module:
@ -148,7 +163,7 @@ Listing of ``example.cars`` module:
"""Dependency injection example, cars module.""" """Dependency injection example, cars module."""
class Car(object): class Car:
"""Example car.""" """Example car."""
def __init__(self, engine): def __init__(self, engine):
@ -168,11 +183,11 @@ The next example demonstrates the creation of several cars with different engine
if __name__ == '__main__': if __name__ == '__main__':
gasoline_car = example.cars.Car(example.engines.GasolineEngine()) gasoline_car = example.cars.Car(example.engines.GasolineEngine())
diesel_car = example.cars.Car(example.engines.DieselEngine()) diesel_car = example.cars.Car(example.engines.DieselEngine())
electro_car = example.cars.Car(example.engines.ElectroEngine()) electric_car = example.cars.Car(example.engines.ElectricEngine())
While the previous example demonstrates the advantages of dependency injection, While the previous example demonstrates the advantages of dependency injection,
there is a disadvantage demonstrated as well - the creation of a car requires there is a disadvantage demonstrated as well - the creation of a car requires
additional code to specificaty its dependencies. However, this disadvantage additional code to specify its dependencies. However, this disadvantage
could be avoided by using a dependency injection framework for the creation of could be avoided by using a dependency injection framework for the creation of
an inversion of control container (IoC container). an inversion of control container (IoC container).
@ -197,7 +212,7 @@ Here's an example of the creation of several inversion of control containers
diesel = providers.Factory(example.engines.DieselEngine) diesel = providers.Factory(example.engines.DieselEngine)
electro = providers.Factory(example.engines.ElectroEngine) electric = providers.Factory(example.engines.ElectricEngine)
class Cars(containers.DeclarativeContainer): class Cars(containers.DeclarativeContainer):
@ -209,14 +224,14 @@ Here's an example of the creation of several inversion of control containers
diesel = providers.Factory(example.cars.Car, diesel = providers.Factory(example.cars.Car,
engine=Engines.diesel) engine=Engines.diesel)
electro = providers.Factory(example.cars.Car, electric = providers.Factory(example.cars.Car,
engine=Engines.electro) engine=Engines.electric)
if __name__ == '__main__': if __name__ == '__main__':
gasoline_car = Cars.gasoline() gasoline_car = Cars.gasoline()
diesel_car = Cars.diesel() diesel_car = Cars.diesel()
electro_car = Cars.electro() electric_car = Cars.electric()
Dependency Injector structure Dependency Injector structure
----------------------------- -----------------------------
@ -376,21 +391,6 @@ on our GitHub:
https://github.com/ets-labs/python-dependency-injector https://github.com/ets-labs/python-dependency-injector
Installation
------------
The *Dependency Injector* library is available on `PyPi`_::
pip install dependency_injector
Documentation
-------------
The *Dependency Injector* documentation is hosted on ReadTheDocs:
- `User's guide`_
- `API docs`_
Feedback & Support Feedback & Support
------------------ ------------------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

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`_
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 3.15.0
------ ------
- Add Python 3.8 support. - Add Python 3.8 support.

View File

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