From bf356ec56515014df503cb1a7f43dc59cf6d0623 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Sun, 17 Apr 2022 10:55:17 -0400 Subject: [PATCH] Update wording in introduction docs --- README.rst | 39 +++++++++++++++--------------- docs/index.rst | 14 +++++------ docs/introduction/index.rst | 4 +-- docs/introduction/installation.rst | 20 +++++++-------- docs/introduction/key_features.rst | 12 ++++----- 5 files changed, 44 insertions(+), 45 deletions(-) diff --git a/README.rst b/README.rst index e3b11e7a..2bcc5be6 100644 --- a/README.rst +++ b/README.rst @@ -48,26 +48,26 @@ What is ``Dependency Injector``? ``Dependency Injector`` is a dependency injection framework for Python. -It helps implementing the dependency injection principle. +It helps implement the dependency injection principle. Key features of the ``Dependency Injector``: - **Providers**. Provides ``Factory``, ``Singleton``, ``Callable``, ``Coroutine``, ``Object``, - ``List``, ``Dict``, ``Configuration``, ``Resource``, ``Dependency`` and ``Selector`` providers - that help assembling your objects. + ``List``, ``Dict``, ``Configuration``, ``Resource``, ``Dependency``, and ``Selector`` providers + that help assemble your objects. See `Providers `_. - **Overriding**. Can override any provider by another provider on the fly. This helps in testing - and configuring dev / stage environment to replace API clients with stubs etc. See + and configuring dev/stage environment to replace API clients with stubs etc. See `Provider overriding `_. - **Configuration**. Reads configuration from ``yaml`` & ``ini`` files, ``pydantic`` settings, environment variables, and dictionaries. See `Configuration provider `_. -- **Containers**. Provides declarative and dynamic containers. - See `Containers `_. - **Resources**. Helps with initialization and configuring of logging, event loop, thread or process pool, etc. Can be used for per-function execution scope in tandem with wiring. See `Resource provider `_. -- **Wiring**. Injects dependencies into functions and methods. Helps integrating with +- **Containers**. Provides declarative and dynamic containers. + See `Containers `_. +- **Wiring**. Injects dependencies into functions and methods. Helps integrate with other frameworks: Django, Flask, Aiohttp, Sanic, FastAPI, etc. See `Wiring `_. - **Asynchronous**. Supports asynchronous injections. @@ -75,7 +75,7 @@ Key features of the ``Dependency Injector``: - **Typing**. Provides typing stubs, ``mypy``-friendly. See `Typing and mypy `_. - **Performance**. Fast. Written in ``Cython``. -- **Maturity**. Mature and production-ready. Well-tested, documented and supported. +- **Maturity**. Mature and production-ready. Well-tested, documented, and supported. .. code-block:: python @@ -115,19 +115,18 @@ Key features of the ``Dependency Injector``: with container.api_client.override(mock.Mock()): main() # <-- overridden dependency is injected automatically -When you call ``main()`` function the ``Service`` dependency is assembled and injected automatically. +When you call the ``main()`` function the ``Service`` dependency is assembled and injected automatically. -When doing a testing you call the ``container.api_client.override()`` to replace the real API -client with a mock. When you call ``main()`` the mock is injected. +When you do testing, you call the ``container.api_client.override()`` method to replace the real API +client with a mock. When you call ``main()``, the mock is injected. You can override any provider with another provider. -It also helps you in configuring project for the different environments: replace an API client +It also helps you in a re-configuring project for different environments: replace an API client with a stub on the dev or stage. -With the ``Dependency Injector`` objects assembling is consolidated in the container. -Dependency injections are defined explicitly. -This makes easier to understand and change how application works. +With the ``Dependency Injector``, object assembling is consolidated in a container. Dependency injections are defined explicitly. +This makes it easier to understand and change how an application works. .. figure:: https://raw.githubusercontent.com/wiki/ets-labs/python-dependency-injector/img/di-readme.svg :target: https://github.com/ets-labs/python-dependency-injector @@ -185,27 +184,27 @@ The framework stands on the `PEP20 (The Zen of Python) `_ diff --git a/docs/index.rst b/docs/index.rst index 9fca971c..70af0b6c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -65,10 +65,10 @@ It helps implementing the dependency injection principle. Key features of the ``Dependency Injector``: - **Providers**. Provides ``Factory``, ``Singleton``, ``Callable``, ``Coroutine``, ``Object``, - ``List``, ``Dict``, ``Configuration``, ``Resource``, ``Dependency`` and ``Selector`` providers - that help assembling your objects. See :ref:`providers`. + ``List``, ``Dict``, ``Configuration``, ``Resource``, ``Dependency``, and ``Selector`` providers + that help assemble your objects. See :ref:`providers`. - **Overriding**. Can override any provider by another provider on the fly. This helps in testing - and configuring dev / stage environment to replace API clients with stubs etc. See + and configuring dev/stage environment to replace API clients with stubs etc. See :ref:`provider-overriding`. - **Configuration**. Reads configuration from ``yaml`` & ``ini`` files, ``pydantic`` settings, environment variables, and dictionaries. See :ref:`configuration-provider`. @@ -76,12 +76,12 @@ Key features of the ``Dependency Injector``: or process pool, etc. Can be used for per-function execution scope in tandem with wiring. See :ref:`resource-provider`. - **Containers**. Provides declarative and dynamic containers. See :ref:`containers`. -- **Wiring**. Injects dependencies into functions and methods. Helps integrating with +- **Wiring**. Injects dependencies into functions and methods. Helps integrate with other frameworks: Django, Flask, Aiohttp, Sanic, FastAPI, etc. See :ref:`wiring`. - **Asynchronous**. Supports asynchronous injections. See :ref:`async-injections`. - **Typing**. Provides typing stubs, ``mypy``-friendly. See :ref:`provider-typing`. - **Performance**. Fast. Written in ``Cython``. -- **Maturity**. Mature and production-ready. Well-tested, documented and supported. +- **Maturity**. Mature and production-ready. Well-tested, documented, and supported. .. code-block:: python @@ -121,9 +121,9 @@ Key features of the ``Dependency Injector``: with container.api_client.override(mock.Mock()): main() # <-- overridden dependency is injected automatically -With the ``Dependency Injector`` objects assembling is consolidated in the container. +With the ``Dependency Injector``, object assembling is consolidated in the container. Dependency injections are defined explicitly. -This makes easier to understand and change how application works. +This makes it easier to understand and change how the application works. .. figure:: https://raw.githubusercontent.com/wiki/ets-labs/python-dependency-injector/img/di-readme.svg :target: https://github.com/ets-labs/python-dependency-injector diff --git a/docs/introduction/index.rst b/docs/introduction/index.rst index b67039df..80ca0704 100644 --- a/docs/introduction/index.rst +++ b/docs/introduction/index.rst @@ -7,8 +7,8 @@ Introduction overview of the dependency injection, inversion of control and Dependency Injector framework. -Current section of the documentation provides an overview of the -dependency injection, inversion of control and the ``Dependency Injector`` framework. +The current section of the documentation provides an overview of the +dependency injection, inversion of control, and the ``Dependency Injector`` framework. .. toctree:: :maxdepth: 2 diff --git a/docs/introduction/installation.rst b/docs/introduction/installation.rst index 4cb4060b..ee3a7b6d 100644 --- a/docs/introduction/installation.rst +++ b/docs/introduction/installation.rst @@ -2,7 +2,7 @@ Installation ============ ``Dependency Injector`` is available on `PyPI `_. -To install latest version you can use ``pip``: +To install the latest version you can use ``pip``: .. code-block:: bash @@ -10,7 +10,7 @@ To install latest version you can use ``pip``: Some modules of the ``Dependency Injector`` are implemented as C extensions. ``Dependency Injector`` is distributed as a pre-compiled wheels. Wheels are -available for all supported Python versions on Linux, Windows and MacOS. +available for all supported Python versions on Linux, Windows, and MacOS. Linux distribution uses `manylinux `_. If there is no appropriate wheel for your environment (Python version and OS) @@ -23,20 +23,20 @@ To verify the installed version: >>> import dependency_injector >>> dependency_injector.__version__ - '4.37.0' + '4.39.0' .. note:: - When add ``Dependency Injector`` to the ``requirements.txt`` don't forget to pin version - to the current major: + When adding ``Dependency Injector`` to ``pyproject.toml`` or ``requirements.txt`` + don't forget to pin the version to the current major: - .. code-block:: bash + .. code-block:: bash - dependency-injector>=4.0,<5.0 + dependency-injector>=4.0,<5.0 - *Next major version can be incompatible.* + *The next major version can be incompatible.* -All releases are available on `PyPI release history page `_. -Each release has appropriate tag. The tags are available on +All releases are available on the `PyPI release history page `_. +Each release has an appropriate tag. The tags are available on the `GitHub releases page `_. .. disqus:: diff --git a/docs/introduction/key_features.rst b/docs/introduction/key_features.rst index 9ee9c663..8ab58582 100644 --- a/docs/introduction/key_features.rst +++ b/docs/introduction/key_features.rst @@ -11,10 +11,10 @@ Key features Key features of the ``Dependency Injector``: - **Providers**. Provides ``Factory``, ``Singleton``, ``Callable``, ``Coroutine``, ``Object``, - ``List``, ``Dict``, ``Configuration``, ``Resource``, ``Dependency`` and ``Selector`` providers - that help assembling your objects. See :ref:`providers`. + ``List``, ``Dict``, ``Configuration``, ``Resource``, ``Dependency``, and ``Selector`` providers + that help assemble your objects. See :ref:`providers`. - **Overriding**. Can override any provider by another provider on the fly. This helps in testing - and configuring dev / stage environment to replace API clients with stubs etc. See + and configuring dev/stage environment to replace API clients with stubs etc. See :ref:`provider-overriding`. - **Configuration**. Reads configuration from ``yaml`` & ``ini`` files, ``pydantic`` settings, environment variables, and dictionaries. See :ref:`configuration-provider`. @@ -22,12 +22,12 @@ Key features of the ``Dependency Injector``: or process pool, etc. Can be used for per-function execution scope in tandem with wiring. See :ref:`resource-provider`. - **Containers**. Provides declarative and dynamic containers. See :ref:`containers`. -- **Wiring**. Injects dependencies into functions and methods. Helps integrating with +- **Wiring**. Injects dependencies into functions and methods. Helps integrate with other frameworks: Django, Flask, Aiohttp, Sanic, FastAPI, etc. See :ref:`wiring`. - **Asynchronous**. Supports asynchronous injections. See :ref:`async-injections`. - **Typing**. Provides typing stubs, ``mypy``-friendly. See :ref:`provider-typing`. - **Performance**. Fast. Written in ``Cython``. -- **Maturity**. Mature and production-ready. Well-tested, documented and supported. +- **Maturity**. Mature and production-ready. Well-tested, documented, and supported. The framework stands on the `PEP20 (The Zen of Python) `_ principle: @@ -37,7 +37,7 @@ The framework stands on the `PEP20 (The Zen of Python)