Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 0 additions & 113 deletions dependency_injector/injections.py

This file was deleted.

25 changes: 0 additions & 25 deletions dependency_injector/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Dependency injector utils module."""

import sys
import copy as _copy
import types
import threading
Expand All @@ -16,12 +15,6 @@
:type: :py:class:`threading.RLock`
"""

_IS_PYPY = '__pypy__' in sys.builtin_module_names
if _IS_PYPY or six.PY3: # pragma: no cover
_OBJECT_INIT = six.get_unbound_function(object.__init__)
else: # pragma: no cover
_OBJECT_INIT = None

if six.PY2: # pragma: no cover
_copy._deepcopy_dispatch[types.MethodType] = \
lambda obj, memo: type(obj)(obj.im_func,
Expand Down Expand Up @@ -90,24 +83,6 @@ def represent_provider(provider, provides):
address=hex(id(provider)))


def fetch_cls_init(cls):
"""Return reference to the class.__init__() method if it is defined.

:param cls: Class instance
:type cls: type

:return: Reference to the class.__init__() if any, or None otherwise.
:rtype: unbound method | None
"""
try:
cls_init = six.get_unbound_function(cls.__init__)
assert cls_init is not _OBJECT_INIT
except (AttributeError, AssertionError):
return None
else:
return cls_init


def deepcopy(instance, memo=None):
"""Make full copy of instance."""
return _copy.deepcopy(instance, memo)
70 changes: 0 additions & 70 deletions docs/advanced_usage/index.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/injections.rst

This file was deleted.

5 changes: 4 additions & 1 deletion docs/main/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ follows `Semantic versioning`_

Development version
-------------------
- No features.
- Remove ``@inject`` decorator.

.. - No features.


2.2.10
------
Expand Down
22 changes: 1 addition & 21 deletions tests/providers/test_creational.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import unittest2 as unittest

from dependency_injector import providers, injections, utils, errors
from dependency_injector import providers, utils, errors


class Example(object):
Expand Down Expand Up @@ -731,26 +731,6 @@ def test_is_delegated_provider(self):
class FactoryAsDecoratorTests(unittest.TestCase):
"""Factory as decorator tests."""

def test_decoration(self):
"""Test decoration of some class with Factory provider."""
@providers.Factory
class AuthService(object):
"""Auth service."""

@providers.Factory
@injections.inject(auth_service=AuthService)
class UsersService(object):
"""Users service."""

def __init__(self, auth_service):
"""Initializer."""
self.auth_service = auth_service

users_service = UsersService()

self.assertIsInstance(users_service, UsersService.cls)
self.assertIsInstance(users_service.auth_service, AuthService.cls)

def test_decoration_and_overriding(self):
"""Test decoration of some class with Factory provider."""
@providers.Factory
Expand Down
Loading