Skip to content

Commit

Permalink
Merge branch release/3.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rmk135 committed Jun 8, 2017
2 parents bc398ce + 67745f8 commit d0b86fa
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 100 deletions.
8 changes: 6 additions & 2 deletions Makefile
Expand Up @@ -58,8 +58,12 @@ check:
pydocstyle examples/

publish: cythonize
# Create and upload build
python setup.py sdist upload
# Merge release to master branch
git checkout master
git merge --no-ff release/$(VERSION) -m 'Merge branch release/$(VERSION)'
git push origin master
# Create and upload tag
git tag -a $(VERSION) -m 'version $(VERSION)'
git push --tags
# Create and upload build
python setup.py sdist upload
4 changes: 4 additions & 0 deletions docs/main/changelog.rst
Expand Up @@ -11,6 +11,10 @@ Development version
-------------------
- No features.

3.4.8
-----
- Code style fixes in ``providers`` module.

3.4.7
-----
- Correct typo in changelog.
Expand Down
2 changes: 1 addition & 1 deletion src/dependency_injector/__init__.py
@@ -1,6 +1,6 @@
"""Dependency injector top-level package."""

__version__ = '3.4.7'
__version__ = '3.4.8'
"""Version number that follows semantic versioning.
:type: str
Expand Down
10 changes: 5 additions & 5 deletions src/dependency_injector/containers.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/dependency_injector/providers.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/dependency_injector/providers.pxd
Expand Up @@ -243,8 +243,8 @@ cdef inline object __callable_call(Callable self, tuple args, dict kwargs):
self.__args,
self.__args_len)
keyword_args = __provide_keyword_args(kwargs,
self.__kwargs,
self.__kwargs_len)
self.__kwargs,
self.__kwargs_len)

return self.__provides(*positional_args, **keyword_args)

Expand Down
114 changes: 29 additions & 85 deletions tests/performance/test.py
Expand Up @@ -38,42 +38,6 @@ def run(self):
gc.enable()
print('\n')

# def test_simple_object(self, providers):
# """Test simple object's creation."""
# class Test(object):
# pass
#
# for x in xrange(int(5000000 * self.duration_factor)):
# Test()
#
# def test_simple_object_factory(self, providers):
# """Test simple object's factory."""
# class Test(object):
# pass
#
# test_factory = providers.Factory(Test)
# for x in xrange(int(5000000 * self.duration_factor)):
# test_factory()
#
# def test_3_ctx_positional_injections(self, providers):
# """Test factory with 3 context positional injections."""
# class Test(object):
# def __init__(self, a, b, c):
# pass
#
# for x in xrange(int(5000000 * self.duration_factor)):
# Test(1, 2, 3)
#
# def test_factory_3_ctx_positional_injections(self, providers):
# """Test factory with 3 context positional injections."""
# class Test(object):
# def __init__(self, a, b, c):
# pass
#
# test_factory = providers.Factory(Test)
# for x in xrange(int(5000000 * self.duration_factor)):
# test_factory(1, 2, 3)

def test_raw_3_kw_injections(self, providers):
"""Test 3 keyword argument injections."""
class A(object):
Expand Down Expand Up @@ -143,55 +107,35 @@ def __init__(self, a, b, c):
for x in xrange(int(5000000 * self.duration_factor)):
test_factory()

# def test_factory_subcls_3_factory_subcls_kw_injections(self, providers):
# """Test factory with 3 keyword argument injections via factories."""
# class MyFactory(providers.Factory):
# pass
#
# class A(object):
# pass
#
# class B(object):
# pass
#
# class C(object):
# pass
#
# class Test(object):
# def __init__(self, a, b, c):
# pass
#
# a_factory = MyFactory(A)
# b_factory = MyFactory(B)
# c_factory = MyFactory(C)
# test_factory = MyFactory(Test,
# a=a_factory,
# b=b_factory,
# c=c_factory)
# for x in xrange(int(5000000 * self.duration_factor)):
# test_factory()

# def test_singleton(self, providers):
# """Test factory with 3 keyword argument injections via factories."""
# class Test(object):
# def __init__(self):
# pass
#
# test_factory = providers.Singleton(Test)
# for x in xrange(int(5000000 * self.duration_factor)):
# test_factory()
#
# def test_singleton_subcls(self, providers):
# """Test factory with 3 keyword argument injections via factories."""
# class MySingleton(providers.Singleton):
# pass
#
# class Test(object):
# pass
#
# test_factory = MySingleton(Test)
# for x in xrange(int(5000000 * self.duration_factor)):
# test_factory()
def test_factory_6_factory_kw_injections_0_context(self, providers):
"""Test factory with 6 keyword argument injections."""
class Test(object):
def __init__(self, a, b, c, d, e, f):
pass

test_factory = providers.Factory(Test, a=1, b=2, c=3, d=4, e=5, f=6)
for x in xrange(int(5000000 * self.duration_factor)):
test_factory()

def test_factory_6_factory_kw_injections_1_context(self, providers):
"""Test factory with 6 keyword argument injections."""
class Test(object):
def __init__(self, a, b, c, d, e, f):
pass

test_factory = providers.Factory(Test, f=6)
for x in xrange(int(5000000 * self.duration_factor)):
test_factory(a=1, b=2, c=3, d=4, e=5)

def test_factory_6_factory_kw_injections_3_context(self, providers):
"""Test factory with 6 keyword argument injections."""
class Test(object):
def __init__(self, a, b, c, d, e, f):
pass

test_factory = providers.Factory(Test, a=1, b=2, c=3)
for x in xrange(int(5000000 * self.duration_factor)):
test_factory(d=4, e=5, f=6)


if __name__ == '__main__':
Expand Down

0 comments on commit d0b86fa

Please sign in to comment.