Skip to content

Commit

Permalink
Merge branch 'release/3.16.1' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rmk135 committed Jun 17, 2020
2 parents efd6e3e + 7c3d961 commit 86021f2
Show file tree
Hide file tree
Showing 9 changed files with 2,510 additions and 2,492 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Expand Up @@ -11,3 +11,4 @@ Dependency Injector Contributors
+ Dmitry Kuzmin (xotonic)
+ supakeen (supakeen)
+ Bruno P. Kinoshita (kinow)
+ RobinsonMa (RobinsonMa)
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/_static/disqus.js
@@ -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);
}})();
});
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -293,4 +293,4 @@


def setup(app):
app.add_stylesheet('sphinx_rtd_theme-hotfix.css')
app.add_css_file('sphinx_rtd_theme-hotfix.css')
21 changes: 14 additions & 7 deletions docs/main/changelog.rst
Expand Up @@ -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.0
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>`_.
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
14 changes: 7 additions & 7 deletions examples/providers/singleton_thread_locals.py
@@ -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,
Expand All @@ -43,8 +43,8 @@ def example(example_object, queue):
# 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
Expand Down
2 changes: 1 addition & 1 deletion src/dependency_injector/__init__.py
@@ -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
Expand Down

0 comments on commit 86021f2

Please sign in to comment.