diff --git a/docs/images/providers/dependency.png b/docs/images/providers/dependency.png new file mode 100644 index 00000000..dfd2f149 Binary files /dev/null and b/docs/images/providers/dependency.png differ diff --git a/docs/images/providers/external_dependency.png b/docs/images/providers/external_dependency.png deleted file mode 100644 index bb48881f..00000000 Binary files a/docs/images/providers/external_dependency.png and /dev/null differ diff --git a/docs/providers/external_dependency.rst b/docs/providers/dependency.rst similarity index 85% rename from docs/providers/external_dependency.rst rename to docs/providers/dependency.rst index 94c845bb..0833373a 100644 --- a/docs/providers/external_dependency.rst +++ b/docs/providers/dependency.rst @@ -1,9 +1,9 @@ -External dependency providers ------------------------------ +Dependency providers +-------------------- .. currentmodule:: dependency_injector.providers -:py:class:`ExternalDependency` provider can be useful for development of +:py:class:`Dependency` provider can be useful for development of self-sufficient libraries / modules / applications that have required external dependencies. @@ -35,11 +35,10 @@ Example: Instead of this, ``UsersService`` has external dependency, that has to be satisfied by cleint's code, out of library's scope. -.. image:: /images/providers/external_dependency.png +.. image:: /images/providers/dependency.png -.. literalinclude:: ../../examples/providers/external_dependency.py +.. literalinclude:: ../../examples/providers/dependency.py :language: python :linenos: - .. disqus:: diff --git a/docs/providers/index.rst b/docs/providers/index.rst index a4fdc4ab..9889b802 100644 --- a/docs/providers/index.rst +++ b/docs/providers/index.rst @@ -21,6 +21,6 @@ Providers package API docs - :py:mod:`dependency_injector.providers` singleton callable object - external_dependency + dependency overriding custom diff --git a/examples/providers/external_dependency.py b/examples/providers/dependency.py similarity index 94% rename from examples/providers/external_dependency.py rename to examples/providers/dependency.py index 83fee602..142db49a 100644 --- a/examples/providers/external_dependency.py +++ b/examples/providers/dependency.py @@ -1,4 +1,4 @@ -"""`ExternalDependency` providers example.""" +"""`Dependency` providers example.""" import sqlite3 import contextlib @@ -45,7 +45,7 @@ class UsersService(object): # Database and UsersService providers: -database = providers.ExternalDependency(instance_of=sqlite3.dbapi2.Connection) +database = providers.Dependency(instance_of=sqlite3.dbapi2.Connection) users_service_factory = providers.Factory(UsersService, database=database)