mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-16 19:40:59 +03:00
Merge branch release/3.4.8
This commit is contained in:
commit
d0b86facb3
8
Makefile
8
Makefile
|
@ -58,8 +58,12 @@ check:
|
||||||
pydocstyle examples/
|
pydocstyle examples/
|
||||||
|
|
||||||
publish: cythonize
|
publish: cythonize
|
||||||
# Create and upload build
|
# Merge release to master branch
|
||||||
python setup.py sdist upload
|
git checkout master
|
||||||
|
git merge --no-ff release/$(VERSION) -m 'Merge branch release/$(VERSION)'
|
||||||
|
git push origin master
|
||||||
# Create and upload tag
|
# Create and upload tag
|
||||||
git tag -a $(VERSION) -m 'version $(VERSION)'
|
git tag -a $(VERSION) -m 'version $(VERSION)'
|
||||||
git push --tags
|
git push --tags
|
||||||
|
# Create and upload build
|
||||||
|
python setup.py sdist upload
|
||||||
|
|
|
@ -11,6 +11,10 @@ Development version
|
||||||
-------------------
|
-------------------
|
||||||
- No features.
|
- No features.
|
||||||
|
|
||||||
|
3.4.8
|
||||||
|
-----
|
||||||
|
- Code style fixes in ``providers`` module.
|
||||||
|
|
||||||
3.4.7
|
3.4.7
|
||||||
-----
|
-----
|
||||||
- Correct typo in changelog.
|
- Correct typo in changelog.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Dependency injector top-level package."""
|
"""Dependency injector top-level package."""
|
||||||
|
|
||||||
__version__ = '3.4.7'
|
__version__ = '3.4.8'
|
||||||
"""Version number that follows semantic versioning.
|
"""Version number that follows semantic versioning.
|
||||||
|
|
||||||
:type: str
|
:type: str
|
||||||
|
|
|
@ -8815,8 +8815,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
|
||||||
/* "providers.pxd":246
|
/* "providers.pxd":246
|
||||||
* self.__args_len)
|
* self.__args_len)
|
||||||
* keyword_args = __provide_keyword_args(kwargs,
|
* keyword_args = __provide_keyword_args(kwargs,
|
||||||
* self.__kwargs, # <<<<<<<<<<<<<<
|
* self.__kwargs, # <<<<<<<<<<<<<<
|
||||||
* self.__kwargs_len)
|
* self.__kwargs_len)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
__pyx_t_2 = __pyx_v_self->__pyx___kwargs;
|
__pyx_t_2 = __pyx_v_self->__pyx___kwargs;
|
||||||
|
@ -8826,8 +8826,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
|
||||||
* self.__args,
|
* self.__args,
|
||||||
* self.__args_len)
|
* self.__args_len)
|
||||||
* keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<<
|
* keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<<
|
||||||
* self.__kwargs,
|
* self.__kwargs,
|
||||||
* self.__kwargs_len)
|
* self.__kwargs_len)
|
||||||
*/
|
*/
|
||||||
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
|
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
|
||||||
__Pyx_GOTREF(__pyx_t_1);
|
__Pyx_GOTREF(__pyx_t_1);
|
||||||
|
@ -8836,7 +8836,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
|
||||||
__pyx_t_1 = 0;
|
__pyx_t_1 = 0;
|
||||||
|
|
||||||
/* "providers.pxd":249
|
/* "providers.pxd":249
|
||||||
* self.__kwargs_len)
|
* self.__kwargs_len)
|
||||||
*
|
*
|
||||||
* return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<<
|
* return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<<
|
||||||
*
|
*
|
||||||
|
|
|
@ -22296,8 +22296,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
|
||||||
/* "dependency_injector/providers.pxd":246
|
/* "dependency_injector/providers.pxd":246
|
||||||
* self.__args_len)
|
* self.__args_len)
|
||||||
* keyword_args = __provide_keyword_args(kwargs,
|
* keyword_args = __provide_keyword_args(kwargs,
|
||||||
* self.__kwargs, # <<<<<<<<<<<<<<
|
* self.__kwargs, # <<<<<<<<<<<<<<
|
||||||
* self.__kwargs_len)
|
* self.__kwargs_len)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
__pyx_t_2 = __pyx_v_self->__pyx___kwargs;
|
__pyx_t_2 = __pyx_v_self->__pyx___kwargs;
|
||||||
|
@ -22307,8 +22307,8 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
|
||||||
* self.__args,
|
* self.__args,
|
||||||
* self.__args_len)
|
* self.__args_len)
|
||||||
* keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<<
|
* keyword_args = __provide_keyword_args(kwargs, # <<<<<<<<<<<<<<
|
||||||
* self.__kwargs,
|
* self.__kwargs,
|
||||||
* self.__kwargs_len)
|
* self.__kwargs_len)
|
||||||
*/
|
*/
|
||||||
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
|
__pyx_t_1 = __pyx_f_19dependency_injector_9providers___provide_keyword_args(__pyx_v_kwargs, ((PyObject*)__pyx_t_2), __pyx_v_self->__pyx___kwargs_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
|
||||||
__Pyx_GOTREF(__pyx_t_1);
|
__Pyx_GOTREF(__pyx_t_1);
|
||||||
|
@ -22317,7 +22317,7 @@ static CYTHON_INLINE PyObject *__pyx_f_19dependency_injector_9providers___callab
|
||||||
__pyx_t_1 = 0;
|
__pyx_t_1 = 0;
|
||||||
|
|
||||||
/* "dependency_injector/providers.pxd":249
|
/* "dependency_injector/providers.pxd":249
|
||||||
* self.__kwargs_len)
|
* self.__kwargs_len)
|
||||||
*
|
*
|
||||||
* return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<<
|
* return self.__provides(*positional_args, **keyword_args) # <<<<<<<<<<<<<<
|
||||||
*
|
*
|
||||||
|
|
|
@ -243,8 +243,8 @@ cdef inline object __callable_call(Callable self, tuple args, dict kwargs):
|
||||||
self.__args,
|
self.__args,
|
||||||
self.__args_len)
|
self.__args_len)
|
||||||
keyword_args = __provide_keyword_args(kwargs,
|
keyword_args = __provide_keyword_args(kwargs,
|
||||||
self.__kwargs,
|
self.__kwargs,
|
||||||
self.__kwargs_len)
|
self.__kwargs_len)
|
||||||
|
|
||||||
return self.__provides(*positional_args, **keyword_args)
|
return self.__provides(*positional_args, **keyword_args)
|
||||||
|
|
||||||
|
|
|
@ -38,42 +38,6 @@ class Tester(object):
|
||||||
gc.enable()
|
gc.enable()
|
||||||
print('\n')
|
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):
|
def test_raw_3_kw_injections(self, providers):
|
||||||
"""Test 3 keyword argument injections."""
|
"""Test 3 keyword argument injections."""
|
||||||
class A(object):
|
class A(object):
|
||||||
|
@ -143,55 +107,35 @@ class Tester(object):
|
||||||
for x in xrange(int(5000000 * self.duration_factor)):
|
for x in xrange(int(5000000 * self.duration_factor)):
|
||||||
test_factory()
|
test_factory()
|
||||||
|
|
||||||
# def test_factory_subcls_3_factory_subcls_kw_injections(self, providers):
|
def test_factory_6_factory_kw_injections_0_context(self, providers):
|
||||||
# """Test factory with 3 keyword argument injections via factories."""
|
"""Test factory with 6 keyword argument injections."""
|
||||||
# class MyFactory(providers.Factory):
|
class Test(object):
|
||||||
# pass
|
def __init__(self, a, b, c, d, e, f):
|
||||||
#
|
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 = providers.Factory(Test, a=1, b=2, c=3, d=4, e=5, f=6)
|
||||||
# """Test factory with 3 keyword argument injections via factories."""
|
for x in xrange(int(5000000 * self.duration_factor)):
|
||||||
# class Test(object):
|
test_factory()
|
||||||
# def __init__(self):
|
|
||||||
# pass
|
def test_factory_6_factory_kw_injections_1_context(self, providers):
|
||||||
#
|
"""Test factory with 6 keyword argument injections."""
|
||||||
# test_factory = providers.Singleton(Test)
|
class Test(object):
|
||||||
# for x in xrange(int(5000000 * self.duration_factor)):
|
def __init__(self, a, b, c, d, e, f):
|
||||||
# test_factory()
|
pass
|
||||||
#
|
|
||||||
# def test_singleton_subcls(self, providers):
|
test_factory = providers.Factory(Test, f=6)
|
||||||
# """Test factory with 3 keyword argument injections via factories."""
|
for x in xrange(int(5000000 * self.duration_factor)):
|
||||||
# class MySingleton(providers.Singleton):
|
test_factory(a=1, b=2, c=3, d=4, e=5)
|
||||||
# pass
|
|
||||||
#
|
def test_factory_6_factory_kw_injections_3_context(self, providers):
|
||||||
# class Test(object):
|
"""Test factory with 6 keyword argument injections."""
|
||||||
# pass
|
class Test(object):
|
||||||
#
|
def __init__(self, a, b, c, d, e, f):
|
||||||
# test_factory = MySingleton(Test)
|
pass
|
||||||
# for x in xrange(int(5000000 * self.duration_factor)):
|
|
||||||
# test_factory()
|
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__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user