diff --git a/README.rst b/README.rst index 20605e58..6e3c696c 100644 --- a/README.rst +++ b/README.rst @@ -60,6 +60,21 @@ Status | | :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 -------------------- @@ -122,7 +137,7 @@ Listing of ``example.engines`` module: """Dependency injection example, engines module.""" - class Engine(object): + class Engine: """Example engine base class. 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.""" - class ElectroEngine(Engine): - """Electro engine.""" + class ElectricEngine(Engine): + """Electric engine.""" Listing of ``example.cars`` module: @@ -148,7 +163,7 @@ Listing of ``example.cars`` module: """Dependency injection example, cars module.""" - class Car(object): + class Car: """Example car.""" def __init__(self, engine): @@ -168,11 +183,11 @@ The next example demonstrates the creation of several cars with different engine if __name__ == '__main__': gasoline_car = example.cars.Car(example.engines.GasolineEngine()) 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, 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 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) - electro = providers.Factory(example.engines.ElectroEngine) + electric = providers.Factory(example.engines.ElectricEngine) 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, engine=Engines.diesel) - electro = providers.Factory(example.cars.Car, - engine=Engines.electro) + electric = providers.Factory(example.cars.Car, + engine=Engines.electric) if __name__ == '__main__': gasoline_car = Cars.gasoline() diesel_car = Cars.diesel() - electro_car = Cars.electro() + electric_car = Cars.electric() Dependency Injector structure ----------------------------- @@ -376,21 +391,6 @@ on our GitHub: 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 ------------------ diff --git a/docs/images/miniapps/engines_cars/diagram.png b/docs/images/miniapps/engines_cars/diagram.png index 6320bfdd..d3b28bb8 100644 Binary files a/docs/images/miniapps/engines_cars/diagram.png and b/docs/images/miniapps/engines_cars/diagram.png differ diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index cb71c263..47d32c87 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -7,6 +7,11 @@ that were made in every particular version. From version 0.7.6 *Dependency Injector* framework strictly 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 ------ - Add Python 3.8 support. diff --git a/src/dependency_injector/__init__.py b/src/dependency_injector/__init__.py index 8d9e7b32..9a8a47c6 100644 --- a/src/dependency_injector/__init__.py +++ b/src/dependency_injector/__init__.py @@ -1,6 +1,6 @@ """Dependency injector top-level package.""" -__version__ = '3.15.0' +__version__ = '3.15.1' """Version number that follows semantic versioning. :type: str