Merge branch 'release/3.16.1' into master

This commit is contained in:
Roman Mogylatov 2020-06-16 22:34:36 -04:00
commit 86021f2948
9 changed files with 2546 additions and 2528 deletions

View File

@ -11,3 +11,4 @@ Dependency Injector Contributors
+ Dmitry Kuzmin (xotonic)
+ supakeen (supakeen)
+ Bruno P. Kinoshita (kinow)
+ RobinsonMa (RobinsonMa)

View File

@ -36,7 +36,7 @@ build: clean cythonize
# Compile C extensions
python setup.py build_ext --inplace
docs-live: clean
docs-live:
sphinx-autobuild docs docs/_build/html
install: uninstall clean cythonize

View File

@ -1,10 +1,11 @@
var disqus_shortname;
var disqus_identifier;
(function() {{
$(function() {
var disqus_thread = $("#disqus_thread");
disqus_shortname = disqus_thread.data('disqus-shortname');
disqus_identifier = disqus_thread.data('disqus-identifier');
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}})();
});

View File

@ -293,4 +293,4 @@ disqus_shortname = 'python-dependency-injector'
def setup(app):
app.add_stylesheet('sphinx_rtd_theme-hotfix.css')
app.add_css_file('sphinx_rtd_theme-hotfix.css')

View File

@ -7,9 +7,16 @@ that were made in every particular version.
From version 0.7.6 *Dependency Injector* framework strictly
follows `Semantic versioning`_
3.16.1
------
- Update ``singleton_thread_locals.py`` to support Python 3 (thanks to
`RobinsonMa <https://github.com/RobinsonMa>`_,
`PR #252 <https://github.com/ets-labs/python-dependency-injector/pull/252>`_).
- Fix Disqus comments.
- Fix warnings in API docs.
3.16.0
------
- Add ``List`` provider
`issue #243 <https://github.com/ets-labs/python-dependency-injector/issues/243>`_,
`PR #251 <https://github.com/ets-labs/python-dependency-injector/pull/251>`_.
@ -19,7 +26,6 @@ follows `Semantic versioning`_
- Add support of six 1.15.0.
- Regenerate C sources using Cython 0.29.20.
3.15.6
------
- Fix changelog typo.
@ -65,18 +71,18 @@ follows `Semantic versioning`_
-------
- Fix ``3.14.11`` degradation issue causing inability of using ``Delegate`` provider in
``DeclarativeContainer`` when this container is instantiated with overriding of delegating
provider (thanks to `GitterRemote <https://github .com/GitterRemote>`_, issue details are
`here <https://github.com/ets-labs/python-dependency-injector/issues/235>`_).
provider (thanks to `GitterRemote <https://github .com/GitterRemote>`_, issue details are here
`#235 <https://github.com/ets-labs/python-dependency-injector/issues/235>`_).
3.14.11
-------
- Fix issue causing creation of a copy of provided object by ``Object`` provider when it was a
part of ``DeclarativeContainer`` and this container was instantiated (thanks to
`davidcim <https://github.com/davidcim>`_, issue details are
`here <https://github.com/ets-labs/python-dependency-injector/issues/231>`_).
`davidcim <https://github.com/davidcim>`_, issue details are here
`#231 <https://github.com/ets-labs/python-dependency-injector/issues/231>`_).
3.14.10
------
-------
- Make spelling fix for the list of contributors.
3.14.9
@ -480,6 +486,7 @@ follows `Semantic versioning`_
2. Add makefile (``clean``, ``test``, ``build``, ``install``, ``uninstall``
& ``publish`` commands).
3. Update repository structure:
1. Sources are moved under ``src/`` folder.
2. Tests are moved under ``tests/unit/`` folder.

View File

@ -1,26 +1,26 @@
"""`ThreadLocalSingleton` providers example."""
import threading
import Queue
import queue
import dependency_injector.providers as providers
def example(example_object, queue):
def example(example_object, queue_object):
"""Put provided object in the provided queue."""
queue.put(example_object)
queue_object.put(example_object)
# Create thread-local singleton provider for some object (main thread):
thread_local_object = providers.ThreadLocalSingleton(object)
# Create singleton provider for thread-safe queue:
queue = providers.Singleton(Queue.Queue)
queue_factory = providers.ThreadSafeSingleton(queue.Queue)
# Create callable provider for example(), inject dependencies:
example = providers.DelegatedCallable(example,
example_object=thread_local_object,
queue=queue)
queue_object=queue_factory)
# Create factory provider for threads that are targeted to execute example():
thread_factory = providers.Factory(threading.Thread,
@ -43,8 +43,8 @@ if __name__ == '__main__':
# Making some asserts (main thread):
all_objects = set()
while not queue().empty():
all_objects.add(queue().get())
while not queue_factory().empty():
all_objects.add(queue_factory().get())
assert len(all_objects) == len(threads)
# Queue contains same number of objects as number of threads where

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -82,6 +82,7 @@ cdef class Provider(object):
All providers should extend this class.
.. py:attribute:: overridden
:noindex:
Tuple of overriding providers, if any.
@ -366,6 +367,7 @@ cdef class Dependency(Provider):
database = database_provider()
.. py:attribute:: instance_of
:noindex:
Class of required dependency.
@ -459,6 +461,7 @@ cdef class ExternalDependency(Dependency):
Use :py:class:`Dependency` instead.
.. py:attribute:: instance_of
:noindex:
Class of required dependency.
@ -1386,6 +1389,7 @@ cdef class DelegatedFactory(Factory):
:type: type | None
.. py:attribute:: cls
:noindex:
Class that provides object.
Alias for :py:attr:`provides`.
@ -1723,6 +1727,7 @@ cdef class Singleton(BaseSingleton):
:type: type | None
.. py:attribute:: cls
:noindex:
Class that provides object.
Alias for :py:attr:`provides`.
@ -1765,6 +1770,7 @@ cdef class DelegatedSingleton(Singleton):
:type: type | None
.. py:attribute:: cls
:noindex:
Class that provides object.
Alias for :py:attr:`provides`.
@ -1821,6 +1827,7 @@ cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton):
:type: type | None
.. py:attribute:: cls
:noindex:
Class that provides object.
Alias for :py:attr:`provides`.
@ -1842,6 +1849,7 @@ cdef class ThreadLocalSingleton(BaseSingleton):
:type: type | None
.. py:attribute:: cls
:noindex:
Class that provides object.
Alias for :py:attr:`provides`.
@ -1889,6 +1897,7 @@ cdef class DelegatedThreadLocalSingleton(ThreadLocalSingleton):
:type: type | None
.. py:attribute:: cls
:noindex:
Class that provides object.
Alias for :py:attr:`provides`.