Giter Club home page Giter Club logo

python-dependency-injector's People

Contributors

ebr avatar gerschtli avatar illia-v avatar jameslafa avatar jarnorfb avatar jeroenrietveld avatar kinow avatar kirill-shershen avatar kootoopas avatar loingo95 avatar metaperl avatar piperubio avatar rajanjha786 avatar rda-dev avatar rmk135 avatar robinsonma avatar sirkonst avatar smirnovskoe avatar sonthonaxrk avatar stummej avatar supakeen avatar thiromi avatar vkfisher avatar whysage avatar withshubh avatar xotonic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-dependency-injector's Issues

Add GA to RTD

Adding of Google Analytics for documentation on RTD

Scoped providers

We need to create a ScopedProvider. The idea is of this provider that it behaves like a singleton, but has not only one scope.

ScopedProvider should support not only one scope and should have functionality for clearing all the scopes.

Fix the crutch with injection.value

Fix the crutch with injection.value:

class Injection(object):

    """Base injection class."""

    def __init__(self, name, injectable):
        """Initializer."""
        self.name = name
        self.injectable = injectable

    @property
    def value(self):
        """Return injectable value."""
        if hasattr(self.injectable, '__is_objects_provider__'):  # TODO: Fix this
            return self.injectable()
        return self.injectable

Integrate Coveralls.io

Integration of Coveralls

Python lib - coveralls-python

Expectations from current integration are:

  • Make unit tests coverage measuring on every commit.
  • Store history of unit tests coverage with attached commits information.
  • Badge about unit tests coverage from shields.io should be placed into main README.md.

Provider.overridden lazy initialization

The idea is not to create overridden list for every Provider instance. This could be done just in override time.

Acceptance criterias:

  • Memory gain need to be calculated.

Callable provider

Need to create Callable provider. Current Function provider is a static provider of an function object.

Idea of Callable is to provide an callable function with some predefined dependencies.

Integrate TravisCI

Integration of TravisCI and tox.

Expectations from current integration are:

  • Make unit tests running automatically on every commit.
  • Tests should be run on Python 2.7.
  • Configuration should be extensible to setup unit testing in other environments (Python 2.6, Python 3, PyPy, etc...)
  • Badge about build's status should be placed into main README.md.

Update README

  • Split concept example into declarative part with some asserts and usage part.
  • Retain only concept example in main REAME.md
  • Add README.md for examples.
  • Add link to examples/README.md in main README.md

Config providers

There are some kind of situations with settings injections that should be handled in special way:

- Most of the systems make settings global usable (Django settings, Flask app.config etc...). This is not a best practice.
- Settings could be defined after the objects catalog is defined. So best what `objects` can do now is:
class Catalog(AbstractCatalog):

    config = ExternalDependency(instance_of=dict)

    consumer = NewInstance(SomeClass,
                           InitArg('config', config))


Catalog.config.satisfy(Object(dict(some_key='some_value')))

The idea is to make special type of provider for such cases:

class Catalog(AbstractCatalog):

    config = Config()

    consumer = NewInstance(SomeClass,
                           InitArg('some_setting', config.some_key))


Catalog.config.satisfy(Object(dict(some_key='some_value')))

Config providers

There are some kind of situations with settings injections that should be handled in special way:

  • Most of the systems make settings global usable (Django settings, Flask app.config etc...). This is not a best practice.
  • Settings could be defined after the objects catalog is defined. So best what objects can do now is:
class Catalog(AbstractCatalog):

    config = ExternalDependency(instance_of=dict)

    consumer = NewInstance(SomeClass,
                           InitArg('config', config))


Catalog.config.satisfy(Object(dict(some_key='some_value')))

The idea is to make special type of provider for such cases:

class Catalog(AbstractCatalog):

    config = Config()

    consumer = NewInstance(SomeClass,
                           InitArg('some_setting', config.some_key))


Catalog.config.satisfy(Object(dict(some_key='some_value')))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.