Finistere / antidote

Dependency injection for Python
MIT License
90 stars 9 forks source link

rework of the notion of resource #11

Closed Finistere closed 5 years ago

Finistere commented 5 years ago

fixes #10

Resources are now identified by a class constant:

from antidote import LazyConfigurationMeta, inject

class Conf(metaclass=LazyConfigurationMeta):
    SOMETHING = 'something'

    def __call__(self, key):
        return key

@inject(dependencies=(Conf.SOMETHING,))
def f(param):
    pass
codecov-io commented 5 years ago

Codecov Report

Merging #11 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #11   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          24     23    -1     
  Lines         749    772   +23     
  Branches      155    152    -3     
=====================================
+ Hits          749    772   +23
Impacted Files Coverage Δ
src/antidote/exceptions.py 100% <ø> (ø) :arrow_up:
src/antidote/core/injection.py 100% <ø> (ø) :arrow_up:
src/antidote/helpers/__init__.py 100% <100%> (ø) :arrow_up:
src/antidote/helpers/conf.py 100% <100%> (ø)
src/antidote/helpers/wire.py 100% <100%> (ø) :arrow_up:
src/antidote/__init__.py 100% <100%> (ø) :arrow_up:
src/antidote/core/container.py 100% <100%> (ø) :arrow_up:
src/antidote/helpers/register.py 100% <100%> (ø) :arrow_up:
src/antidote/helpers/provider.py 100% <100%> (ø) :arrow_up:
src/antidote/providers/service.py 100% <100%> (ø) :arrow_up:
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 667977d...8eab158. Read the comment docs.