diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 94c7ab7..cf0d61c 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.4.0 +current_version = 3.4.1 [bumpversion:file:Makefile] search = CURRENT_VERSION = {current_version} diff --git a/.gitignore b/.gitignore index f8d4832..198f120 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,6 @@ ENV/ # PyCharm .idea/ + +# vscode +.vscode/ diff --git a/AUTHORS.rst b/AUTHORS.rst index a83954d..13dc63a 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -3,3 +3,4 @@ Authors ======= * Rodrigo Martins de Oliveira - https://github.com/allrod5 +* Craig Minihan - https://github.com/craigminihan diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 34c80e1..db23567 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ Changelog ========= +3.4.1 (2020-05-11) +------------------ + +* Fix the use of named args by the caller breaking autowired functions injection + 3.4.0 (2020-05-09) ------------------ diff --git a/Makefile b/Makefile index 66ba434..2fc986d 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ docs: make html -B cp -a build/html/. docs -CURRENT_VERSION = 3.4.0 +CURRENT_VERSION = 3.4.1 .PHONY: bump-patch-version bump-patch-version: diff --git a/docs/.buildinfo b/docs/.buildinfo index 4591851..b0945dd 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e8b2b421cce8e7ab698d3e3acbafebee +config: fdb100afd8af971a7f6d7bb34cc70893 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_modules/index.html b/docs/_modules/index.html index 2cf0d24..f6ed143 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -3,7 +3,7 @@ - Overview: module code — injectable 3.4.0 documentation + Overview: module code — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -106,8 +106,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/autowiring/autowired_decorator.html b/docs/_modules/injectable/autowiring/autowired_decorator.html index 641cfba..ee07da3 100644 --- a/docs/_modules/injectable/autowiring/autowired_decorator.html +++ b/docs/_modules/injectable/autowiring/autowired_decorator.html @@ -3,7 +3,7 @@ - injectable.autowiring.autowired_decorator — injectable 3.4.0 documentation + injectable.autowiring.autowired_decorator — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -117,10 +117,10 @@

Source code for injectable.autowiring.autowired_decorator

if parameter.name in bound_arguments: continue dependency = parameter.annotation.inject() - if parameter.kind is parameter.KEYWORD_ONLY: - kwargs[parameter.name] = dependency - else: + if parameter.kind is parameter.POSITIONAL_ONLY: args.append(dependency) + else: + kwargs[parameter.name] = dependency return func(*args, **kwargs) @@ -173,8 +173,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/autowiring/autowired_type.html b/docs/_modules/injectable/autowiring/autowired_type.html index d9d3b87..fb8a9a0 100644 --- a/docs/_modules/injectable/autowiring/autowired_type.html +++ b/docs/_modules/injectable/autowiring/autowired_type.html @@ -3,7 +3,7 @@ - injectable.autowiring.autowired_type — injectable 3.4.0 documentation + injectable.autowiring.autowired_type — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -236,8 +236,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/container/injectable.html b/docs/_modules/injectable/container/injectable.html index 040c3f8..25dff7a 100644 --- a/docs/_modules/injectable/container/injectable.html +++ b/docs/_modules/injectable/container/injectable.html @@ -3,7 +3,7 @@ - injectable.container.injectable — injectable 3.4.0 documentation + injectable.container.injectable — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -143,8 +143,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/container/injection_container.html b/docs/_modules/injectable/container/injection_container.html index c8b22eb..d15048d 100644 --- a/docs/_modules/injectable/container/injection_container.html +++ b/docs/_modules/injectable/container/injection_container.html @@ -3,7 +3,7 @@ - injectable.container.injection_container — injectable 3.4.0 documentation + injectable.container.injection_container — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -282,8 +282,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/container/load_injection_container.html b/docs/_modules/injectable/container/load_injection_container.html index f8a7d90..7124dbd 100644 --- a/docs/_modules/injectable/container/load_injection_container.html +++ b/docs/_modules/injectable/container/load_injection_container.html @@ -3,7 +3,7 @@ - injectable.container.load_injection_container — injectable 3.4.0 documentation + injectable.container.load_injection_container — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -138,8 +138,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/errors/autowiring_error.html b/docs/_modules/injectable/errors/autowiring_error.html index ac527bf..75f674c 100644 --- a/docs/_modules/injectable/errors/autowiring_error.html +++ b/docs/_modules/injectable/errors/autowiring_error.html @@ -3,7 +3,7 @@ - injectable.errors.autowiring_error — injectable 3.4.0 documentation + injectable.errors.autowiring_error — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -100,8 +100,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/errors/injection_error.html b/docs/_modules/injectable/errors/injection_error.html index f5884a3..c1a1a56 100644 --- a/docs/_modules/injectable/errors/injection_error.html +++ b/docs/_modules/injectable/errors/injection_error.html @@ -3,7 +3,7 @@ - injectable.errors.injection_error — injectable 3.4.0 documentation + injectable.errors.injection_error — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -100,8 +100,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/injection/inject.html b/docs/_modules/injectable/injection/inject.html index a75e655..95999e9 100644 --- a/docs/_modules/injectable/injection/inject.html +++ b/docs/_modules/injectable/injection/inject.html @@ -3,7 +3,7 @@ - injectable.injection.inject — injectable 3.4.0 documentation + injectable.injection.inject — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -267,8 +267,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/injection/injectable_decorator.html b/docs/_modules/injectable/injection/injectable_decorator.html index e265484..9f2f3de 100644 --- a/docs/_modules/injectable/injection/injectable_decorator.html +++ b/docs/_modules/injectable/injection/injectable_decorator.html @@ -3,7 +3,7 @@ - injectable.injection.injectable_decorator — injectable 3.4.0 documentation + injectable.injection.injectable_decorator — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -153,8 +153,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/injection/injectable_factory_decorator.html b/docs/_modules/injectable/injection/injectable_factory_decorator.html index 4b07d32..ee9b73c 100644 --- a/docs/_modules/injectable/injection/injectable_factory_decorator.html +++ b/docs/_modules/injectable/injection/injectable_factory_decorator.html @@ -3,7 +3,7 @@ - injectable.injection.injectable_factory_decorator — injectable 3.4.0 documentation + injectable.injection.injectable_factory_decorator — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -170,8 +170,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/testing/clear_injectables_util.html b/docs/_modules/injectable/testing/clear_injectables_util.html index 99fbb0e..0e073ff 100644 --- a/docs/_modules/injectable/testing/clear_injectables_util.html +++ b/docs/_modules/injectable/testing/clear_injectables_util.html @@ -3,7 +3,7 @@ - injectable.testing.clear_injectables_util — injectable 3.4.0 documentation + injectable.testing.clear_injectables_util — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -129,8 +129,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/testing/register_injectables_util.html b/docs/_modules/injectable/testing/register_injectables_util.html index 09d6e5c..f2e26e3 100644 --- a/docs/_modules/injectable/testing/register_injectables_util.html +++ b/docs/_modules/injectable/testing/register_injectables_util.html @@ -3,7 +3,7 @@ - injectable.testing.register_injectables_util — injectable 3.4.0 documentation + injectable.testing.register_injectables_util — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -150,8 +150,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/injectable/testing/reset_injection_container_util.html b/docs/_modules/injectable/testing/reset_injection_container_util.html index 193b2ff..a1973c9 100644 --- a/docs/_modules/injectable/testing/reset_injection_container_util.html +++ b/docs/_modules/injectable/testing/reset_injection_container_util.html @@ -3,7 +3,7 @@ - injectable.testing.reset_injection_container_util — injectable 3.4.0 documentation + injectable.testing.reset_injection_container_util — injectable 3.4.1 documentation @@ -28,7 +28,7 @@

Navigation

@@ -113,8 +113,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index a281c2e..cd40594 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '3.4.0', + VERSION: '3.4.1', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/authors.html b/docs/authors.html index 4451ce5..2e6880b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -3,7 +3,7 @@ - Authors — injectable 3.4.0 documentation + Authors — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -50,6 +50,7 @@

Navigation

Authors

@@ -113,8 +114,8 @@

Navigation

\ No newline at end of file diff --git a/docs/changelog.html b/docs/changelog.html index 50e057c..3430b4f 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -3,7 +3,7 @@ - Changelog — injectable 3.4.0 documentation + Changelog — injectable 3.4.1 documentation @@ -29,7 +29,7 @@

Navigation

@@ -48,7 +48,13 @@

Navigation

Changelog

-

3.4.0 (2020-05-09)

+

3.4.1 (2020-05-11)

+ +
+
+

3.4.0 (2020-05-09)

-
-

3.3.0 (2020-04-20)

+
+

3.3.0 (2020-04-20)

  • Include the injectable.testing utilities to ease mocking injectables.

-
-

3.2.1 (2020-04-19)

+
+

3.2.1 (2020-04-19)

  • InjectionContainer::load is more resilient against duplicated injectables

    registering

    @@ -73,32 +79,32 @@

    3.2.1 (2020-04-19) -

    3.2.0 (2020-04-15)

    +
    +

    3.2.0 (2020-04-15)

    • Support for optional injection in declarative fashion: Autowired(Optional[...])

    -
    -

    3.1.4 (2020-04-15)

    +
    +

    3.1.4 (2020-04-15)

    • Fix Autowired(List[...]) not working with qualifiers

    -
    -

    3.1.3 (2020-04-15)

    +
    +

    3.1.3 (2020-04-15)

    • Fix Windows injectables not being loaded.

    -
    -

    3.1.2 (2020-04-14)

    +
    +

    3.1.2 (2020-04-14)

    • Remove unused inspect imports.

    -
    -

    3.1.1 (2020-04-13)

    +
    +

    3.1.1 (2020-04-13)

    @@ -130,8 +130,8 @@

    Navigation

    \ No newline at end of file diff --git a/docs/reference/injectable_testing.html b/docs/reference/injectable_testing.html index 13d62c9..ba4ab36 100644 --- a/docs/reference/injectable_testing.html +++ b/docs/reference/injectable_testing.html @@ -3,7 +3,7 @@ - injectable.testing — injectable 3.4.0 documentation + injectable.testing — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

    Navigation

    @@ -207,8 +207,8 @@

    Navigation

    \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js index d5c157e..1b6f863 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["authors","changelog","contributing","index","installation","readme","reference/index","reference/injectable","reference/injectable_constants","reference/injectable_errors","reference/injectable_testing","usage/basic_usage","usage/cyclic_dependency","usage/dependencies_precedence","usage/factory","usage/illustrative_example","usage/index","usage/lazy_injection","usage/multiple_namespaces","usage/optional_injection","usage/qualifier_overloading","usage/singletons","usage/testing_example"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["authors.rst","changelog.rst","contributing.rst","index.rst","installation.rst","readme.rst","reference/index.rst","reference/injectable.rst","reference/injectable_constants.rst","reference/injectable_errors.rst","reference/injectable_testing.rst","usage/basic_usage.rst","usage/cyclic_dependency.rst","usage/dependencies_precedence.rst","usage/factory.rst","usage/illustrative_example.rst","usage/index.rst","usage/lazy_injection.rst","usage/multiple_namespaces.rst","usage/optional_injection.rst","usage/qualifier_overloading.rst","usage/singletons.rst","usage/testing_example.rst"],objects:{"":{injectable:[7,0,0,"-"]},"examples.basic_usage":{main:[11,0,0,"-"]},"examples.cyclic_dependency":{main:[12,0,0,"-"]},"examples.dependencies_precedence":{main:[13,0,0,"-"]},"examples.factory":{main:[14,0,0,"-"]},"examples.illustrative_example":{illustrative_example:[15,0,0,"-"]},"examples.lazy_injection":{main:[17,0,0,"-"]},"examples.multiple_namespaces":{main:[18,0,0,"-"]},"examples.optional_injection":{main:[19,0,0,"-"]},"examples.qualifier_overloading":{main:[20,0,0,"-"]},"examples.singletons":{main:[21,0,0,"-"]},"examples.testing":{testing_example:[22,0,0,"-"]},"injectable.InjectionContainer":{load:[7,2,1,""]},"injectable.constants":{DEFAULT_NAMESPACE:[8,4,1,""]},"injectable.errors":{AutowiringError:[9,5,1,""],InjectionError:[9,5,1,""]},"injectable.testing":{clear_injectables:[10,3,1,""],register_injectables:[10,3,1,""],reset_injection_container:[10,3,1,""]},injectable:{Autowired:[7,1,1,""],Injectable:[7,1,1,""],InjectionContainer:[7,1,1,""],autowired:[7,3,1,""],constants:[8,0,0,"-"],errors:[9,0,0,"-"],inject:[7,3,1,""],inject_multiple:[7,3,1,""],injectable:[7,3,1,""],injectable_factory:[7,3,1,""],load_injection_container:[7,3,1,""],testing:[10,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"],"4":["py","data","Python data"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function","4":"py:data","5":"py:exception"},terms:{"case":[2,7],"class":[1,5,7,10,11,12,13,14,15,17,18,19,20,21,22],"default":[1,7,8,10],"function":[5,7,9,10,14,22],"import":[1,5,7,10,11,12,13,14,15,17,18,19,20,21,22],"long":10,"new":[7,10],"public":7,"return":[7,10,12,13,14,21],"static":[1,5],"true":[5,7,10,12,13,17,21],"while":2,Added:1,One:7,SMS:20,The:[7,10],These:5,Use:7,Will:7,__init__:[5,7,11,12,13,14,15,17,18,19,20,21,22],__main__:[11,12,13,14,15,17,18,19,20,21,22],__name__:[11,12,13,14,15,17,18,19,20,21,22],_global:1,_namespac:[],abc:[5,13,20],about:[2,20],absolut:7,abstract_servic:13,abstractmethod:[13,20],abstractservic:[7,13],accept:[1,7],action:7,actual:5,add:[1,2,7,18],add_on:11,add_two:11,address:7,advantag:20,after:7,against:1,alia:[],all:[5,7,10],allrod5:0,alreadi:[7,10],also:[7,11,12,13,14,15,17,18,19,20,21,22],ambigu:7,among:7,analysi:5,ani:[2,7],annot:[1,5,7,11],api:7,appli:7,applic:2,aren:7,arg:7,argument:[1,5,7],assert_cal:22,assign:7,attempt:7,author:3,auto:2,automat:[5,7],autowir:[1,5,7,9,11,12,13,14,15,17,18,19,20,21,22],autowiringerror:[7,9],avail:[],bar:[7,19],base:[5,7,10],basic:[3,15,16],basic_usag:11,basicusag:11,befor:7,behaviour:21,behind:11,being:[1,7],beta:1,better:2,black:2,bool:[7,10],branch:2,brief:2,broker:5,bug:1,built:5,builtin:1,bunch_of_servic:19,call:[1,5,7,17],callabl:7,caller:7,can:[1,5,7,12,14,18,22],cannot:7,carefulli:5,chang:[1,10],changelog:3,check:[2,5],circular:12,clarifi:2,classmethod:7,clear:[2,7,10],clear_inject:[10,22],client:14,client_endpoint:14,client_factori:14,client_on:14,client_two:14,client_typ:14,clienton:14,clienttwo:14,cls:7,code:[1,2],collect:[7,10],com:[0,7],combin:13,command:4,comment:2,complet:11,compli:5,composite_singleton:21,compositesingleton:21,configuration_servic:14,configurationservic:14,conjunct:7,connect:14,consol:1,constant:[3,6,7,10],constructor:[1,7,10],contain:[7,10],content:1,contribut:3,cool:5,core:[],correct:7,counter:[11,18,21],creat:7,cryptic:2,custom:[7,9],cyclic:[3,16],cyclicdepend:12,databas:5,deal:12,declar:[1,5,7,11,13,17,19],decor:[1,5,7,11],def:[5,7,11,12,13,14,15,17,18,19,20,21,22],default_namespac:[1,7,8,10],defin:[7,10,21],demonstr:21,dep:[5,7,15,22],depend:[1,3,7,9,10,11,16,18,20,21,22],dependable_servic:11,dependableservic:11,dependencies_preced:13,dependenciespreced:13,deprec:[1,7],descript:2,design:[5,7],differ:[1,5,7],direct:7,directli:7,directori:7,discourag:2,discov:5,discoveri:5,doc:5,docstr:2,document:[1,2],doe:[1,7],drop:1,due:7,duplic:[1,7],each:11,eas:[1,10],easier:12,either:7,eleg:5,elif:14,email:20,email_sender_servic:20,emailsenderservic:20,empti:7,enabl:1,encourag:2,endpoint:14,ensur:2,environ:1,error:[3,6,7],even_count:18,even_counter_servic:18,evencounterservic:18,exampl:[1,2,3,7,10],except:9,exclud:7,exclude_group:[7,20],execut:7,explicitli:[7,13],extend:5,facotri:[],factori:[1,3,7,16],fail:[1,9],fals:[7,10],fashion:[1,5],favor:1,fax:20,fax_sender_servic:20,faxsenderservic:20,featur:3,feedback:2,few:5,file:[7,10,15],filter:7,finish:17,first:[1,7],fix:1,follow:2,foo:[5,7,10,15,19],foo_factori:7,fork:2,form:2,format:2,found:7,framework:[5,11,12,15],friendli:5,from:[1,5,7,10,11,12,13,14,15,17,18,19,20,21,22],func:7,func_parti:[],futur:7,gener:[1,7],github:0,given:[7,10],global:7,grasp:11,group:[1,7,20],guidelin:2,happen:1,hard:2,heart:5,hello:20,hint:5,how:[7,10,11,12,14,17,18,19,21,22],http:[0,14],human:3,idea:11,identifi:7,illustr:[3,11,16],illustrative_exampl:15,illustrativeexampl:15,imposs:7,includ:[1,2],inclus:10,independ:11,index:3,indic:[7,9],infer:1,inform:7,initi:[1,5,7],inject:[1,3,4,6,11,12,13,14,15,16,18,20,21,22],inject_multipl:[1,7],injectable_factori:[1,7,14],injectable_factory_decor:14,injectableloaderror:7,injection_contain:[],injectioncontain:[1,7],injectioncontainernotloadederror:[],injectionerror:[7,9],insid:7,inspect:1,instal:[1,3],instanc:[5,7,11,20],instanti:[1,7],instead:[1,7],invoc:7,invok:7,isn:7,issu:2,its:21,itself:[2,7],just:5,kafkaproduc:5,keep:2,kind:2,klass:10,lambda:[10,22],last:7,lazi:[1,3,5,7,12,16],lazy_inject:17,lazy_object_proxi:1,lazy_servic:17,lazyinject:17,lazyservic:17,learn:[12,20],least:[7,10],level:7,licens:5,like:5,line:4,linter:[2,5],list:[1,5,7,19,20],load:[1,7],load_injection_contain:[1,5,7,11,12,13,14,15,17,18,19,20,21,22],local:[],locat:1,log:7,look:7,lookup:7,love:3,low:7,maco:1,made:7,magic:[2,7],mai:2,main:[11,12,13,14,17,18,19,20,21],make:[1,2,5,7,11,12,13,14,15,17,18,19,20,21,22],manag:7,mani:5,manual:10,mark:[1,7],martin:0,master:2,match:7,meant:7,messag:[5,12,20],message_a:12,message_b:12,message_brok:5,method:[1,7,11],mind:2,minor:1,miss:1,mock:[1,10,22],mocked_dep:22,mocked_inject:22,mockeddep:22,model:5,modul:[1,3,7],more:[1,7],multipl:[1,3,7,16,20],multiplenamespac:18,multipli:13,multiply_servic:13,multiplyservic:13,must:7,name:1,namespac:[1,3,5,7,8,10,16],necessari:7,need:[2,7,10],never:7,nevertheless:2,non:7,none:[7,10,19],odd:18,odd_count:18,odd_counter_servic:18,oddcounterservic:18,offici:1,often:2,old:20,oliveira:0,onc:[1,7],one:[7,10,22],ones:7,onli:[5,7],open:2,option:[1,3,7,10,16],optionalinject:19,organ:2,origin:5,other:[7,11],otherwis:10,our:[5,11],out:[5,7],output:1,outsid:7,overload:[3,5,16],own:[],packag:[1,5],page:3,paramet:[1,5,7,10],parameter_valid:[],parameter_validation_decor:[],parameters_valid:[],parenthesi:[1,7],pass:[5,7],path:[1,5,7],pend:5,perform:7,pip:[1,4],place:7,posit:7,possibl:1,preced:[3,16],present:7,preserv:5,prevent:7,previou:[1,7],previous:7,primari:[7,13],print:[11,12,13,14,15,17,18,19,20,21,22],project:[2,5],propag:10,properti:[12,21],provid:[1,10],pull:2,purpos:7,pycharm:5,python:[1,7,15],qualifi:[1,3,5,7,10,12,13,14,16,18],qualifier_overload:20,qualifieroverload:20,quirk:1,rais:[1,7,9,10,14],readabl:2,readi:5,realdep:22,reason:7,receiv:[2,7],recipi:20,recommend:7,record:10,recurs:10,refactor:1,refer:[3,12],regard:7,regardless:7,regist:[1,7,8,10],register_inject:[10,22],registri:7,rel:[1,7],releas:1,remov:[1,7],repositori:2,request:[2,7],requir:1,reset:10,reset_injection_contain:[1,10],resili:1,resolut:7,resolv:7,respect:7,retrieve_pending_messag:5,review:2,rodrigo:0,root:5,rst:[],run:[1,2,11,12,13,14,15,17,18,19,20,21,22],runtimeerror:14,same:[1,5,7],scan:[1,7,10],search:[1,3,7,8],search_path:7,section:[7,10],see:[13,14,17,18,19,21],self:[5,7,11,12,13,14,15,17,18,19,20,21,22],send:20,send_messag:20,send_pend:5,sender_servic:20,senderservic:20,sequenc:7,servic:[1,5,7,11,13,20,21],service_a:12,service_b:12,servicea:12,serviceb:12,set:10,setter:21,setup:7,shall:7,share:[5,7],should:7,shouldn:7,show:10,side_effect:22,signatur:1,simpl:5,simple_servic:11,simple_singleton:21,simpleservic:11,simplesingleton:21,sinc:7,singl:[5,15],singleton:[3,5,7,16],sms_sender_servic:20,smssenderservic:20,some:[],some_servic:19,someth:17,sourc:[7,9,10],speak:2,specif:7,specifi:[5,7,10],sqsproduc:5,stabl:1,staticmethod:22,still:7,store:7,str:[7,10,14,20],string:[1,7],style:2,submit:2,subsect:[],success:7,suit:1,suitabl:1,sum:13,sum_servic:13,sumservic:13,support:1,sure:7,take:20,test:[1,2,3,5,6,7,11,12,13,14,15,16,17,18,19,20,21],testing_exampl:22,testingexampl:22,than:[1,2,7],them:5,themselv:7,thi:[2,7,10,11,12,13,14,15,17,18,19,20,21,22],thoroughli:2,though:7,through:1,time:[1,7],ton:1,trail:7,transpar:5,trial:1,tricki:2,turn:[],type:[1,5,7,10,11,19,20],typeerror:1,ubuntu:1,unabl:7,under:7,union:[7,10],uniqu:7,unique_id:7,unit:[1,2],unittest:22,unknown:14,unless:10,unus:1,usag:[1,3,7,10,15],use:[1,2,5,7,10,13,14,18,22],used:[5,7,8],using:[1,7,11,19],util:[1,7,10,22],uuid:7,valid:7,validation_parti:[],valu:[7,21],valueerror:10,varieti:7,version:[7,10],wai:2,want:2,warn:7,wasn:7,welcom:2,well:2,what:2,when:[1,5,7,10],whenev:[],where:7,which:[1,7,10],whoch:[],window:1,wire:7,without:[1,7],won:10,work:1,world:20,wrap:[7,22],write:2,wrote:2,you:[2,3,11,12,13,14,17,18,19,20,21],your:[2,5]},titles:["Authors","Changelog","Contributing","Contents","Installation","Injectable: Dependency Injection for Humans\u2122","Reference","injectable","injectable.constants","injectable.errors","injectable.testing","Basic Usage Example","Cyclic Dependency Example","Dependencies Precedence Example","Factory Example","Illustrative Example","Usage Examples","Lazy Injection Example","Multiple Namespaces Example","Optional Injection Example","Qualifier Overloading Example","Singletons Example","Testing Example"],titleterms:{author:0,basic:11,changelog:1,constant:8,content:3,contribut:2,cyclic:12,depend:[5,12,13],error:9,exampl:[11,12,13,14,15,16,17,18,19,20,21,22],factori:14,featur:5,human:5,illustr:15,indic:3,inject:[5,7,8,9,10,17,19],instal:4,lazi:17,love:5,multipl:18,namespac:18,option:19,overload:20,preced:13,qualifi:20,refer:6,singleton:21,tabl:3,test:[10,22],usag:[11,16],you:5}}) \ No newline at end of file +Search.setIndex({docnames:["authors","changelog","contributing","index","installation","readme","reference/index","reference/injectable","reference/injectable_constants","reference/injectable_errors","reference/injectable_testing","usage/basic_usage","usage/cyclic_dependency","usage/dependencies_precedence","usage/factory","usage/illustrative_example","usage/index","usage/lazy_injection","usage/multiple_namespaces","usage/optional_injection","usage/qualifier_overloading","usage/singletons","usage/testing_example"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":2,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["authors.rst","changelog.rst","contributing.rst","index.rst","installation.rst","readme.rst","reference/index.rst","reference/injectable.rst","reference/injectable_constants.rst","reference/injectable_errors.rst","reference/injectable_testing.rst","usage/basic_usage.rst","usage/cyclic_dependency.rst","usage/dependencies_precedence.rst","usage/factory.rst","usage/illustrative_example.rst","usage/index.rst","usage/lazy_injection.rst","usage/multiple_namespaces.rst","usage/optional_injection.rst","usage/qualifier_overloading.rst","usage/singletons.rst","usage/testing_example.rst"],objects:{"":{injectable:[7,0,0,"-"]},"examples.basic_usage":{main:[11,0,0,"-"]},"examples.cyclic_dependency":{main:[12,0,0,"-"]},"examples.dependencies_precedence":{main:[13,0,0,"-"]},"examples.factory":{main:[14,0,0,"-"]},"examples.illustrative_example":{illustrative_example:[15,0,0,"-"]},"examples.lazy_injection":{main:[17,0,0,"-"]},"examples.multiple_namespaces":{main:[18,0,0,"-"]},"examples.optional_injection":{main:[19,0,0,"-"]},"examples.qualifier_overloading":{main:[20,0,0,"-"]},"examples.singletons":{main:[21,0,0,"-"]},"examples.testing":{testing_example:[22,0,0,"-"]},"injectable.InjectionContainer":{load:[7,2,1,""]},"injectable.constants":{DEFAULT_NAMESPACE:[8,4,1,""]},"injectable.errors":{AutowiringError:[9,5,1,""],InjectionError:[9,5,1,""]},"injectable.testing":{clear_injectables:[10,3,1,""],register_injectables:[10,3,1,""],reset_injection_container:[10,3,1,""]},injectable:{Autowired:[7,1,1,""],Injectable:[7,1,1,""],InjectionContainer:[7,1,1,""],autowired:[7,3,1,""],constants:[8,0,0,"-"],errors:[9,0,0,"-"],inject:[7,3,1,""],inject_multiple:[7,3,1,""],injectable:[7,3,1,""],injectable_factory:[7,3,1,""],load_injection_container:[7,3,1,""],testing:[10,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"],"4":["py","data","Python data"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function","4":"py:data","5":"py:exception"},terms:{"break":1,"case":[2,7],"class":[1,5,7,10,11,12,13,14,15,17,18,19,20,21,22],"default":[1,7,8,10],"function":[1,5,7,9,10,14,22],"import":[1,5,7,10,11,12,13,14,15,17,18,19,20,21,22],"long":10,"new":[7,10],"public":7,"return":[7,10,12,13,14,21],"static":[1,5],"true":[5,7,10,12,13,17,21],"while":2,Added:1,One:7,SMS:20,The:[7,10],These:5,Use:7,Will:7,__init__:[5,7,11,12,13,14,15,17,18,19,20,21,22],__main__:[11,12,13,14,15,17,18,19,20,21,22],__name__:[11,12,13,14,15,17,18,19,20,21,22],_global:1,_namespac:[],abc:[5,13,20],about:[2,20],absolut:7,abstract_servic:13,abstractmethod:[13,20],abstractservic:[7,13],accept:[1,7],action:7,actual:5,add:[1,2,7,18],add_on:11,add_two:11,address:7,advantag:20,after:7,against:1,alia:[],all:[5,7,10],allrod5:0,alreadi:[7,10],also:[7,11,12,13,14,15,17,18,19,20,21,22],ambigu:7,among:7,analysi:5,ani:[2,7],annot:[1,5,7,11],api:7,appli:7,applic:2,aren:7,arg:[1,7],argument:[1,5,7],assert_cal:22,assign:7,attempt:7,author:3,auto:2,automat:[5,7],autowir:[1,5,7,9,11,12,13,14,15,17,18,19,20,21,22],autowiringerror:[7,9],avail:[],bar:[7,19],base:[5,7,10],basic:[3,15,16],basic_usag:11,basicusag:11,befor:7,behaviour:21,behind:11,being:[1,7],beta:1,better:2,black:2,bool:[7,10],branch:2,brief:2,broker:5,bug:1,built:5,builtin:1,bunch_of_servic:19,call:[1,5,7,17],callabl:7,caller:[1,7],can:[1,5,7,12,14,18,22],cannot:7,carefulli:5,chang:[1,10],changelog:3,check:[2,5],circular:12,clarifi:2,classmethod:7,clear:[2,7,10],clear_inject:[10,22],client:14,client_endpoint:14,client_factori:14,client_on:14,client_two:14,client_typ:14,clienton:14,clienttwo:14,cls:7,code:[1,2],collect:[7,10],com:[0,7],combin:13,command:4,comment:2,complet:11,compli:5,composite_singleton:21,compositesingleton:21,configuration_servic:14,configurationservic:14,conjunct:7,connect:14,consol:1,constant:[3,6,7,10],constructor:[1,7,10],contain:[7,10],content:1,contribut:3,cool:5,core:[],correct:7,counter:[11,18,21],craig:0,craigminihan:0,creat:7,cryptic:2,custom:[7,9],cyclic:[3,16],cyclicdepend:12,databas:5,deal:12,declar:[1,5,7,11,13,17,19],decor:[1,5,7,11],def:[5,7,11,12,13,14,15,17,18,19,20,21,22],default_namespac:[1,7,8,10],defin:[7,10,21],demonstr:21,dep:[5,7,15,22],depend:[1,3,7,9,10,11,16,18,20,21,22],dependable_servic:11,dependableservic:11,dependencies_preced:13,dependenciespreced:13,deprec:[1,7],descript:2,design:[5,7],differ:[1,5,7],direct:7,directli:7,directori:7,discourag:2,discov:5,discoveri:5,doc:5,docstr:2,document:[1,2],doe:[1,7],drop:1,due:7,duplic:[1,7],each:11,eas:[1,10],easier:12,either:7,eleg:5,elif:14,email:20,email_sender_servic:20,emailsenderservic:20,empti:7,enabl:1,encourag:2,endpoint:14,ensur:2,environ:1,error:[3,6,7],even_count:18,even_counter_servic:18,evencounterservic:18,exampl:[1,2,3,7,10],except:9,exclud:7,exclude_group:[7,20],execut:7,explicitli:[7,13],extend:5,facotri:[],factori:[1,3,7,16],fail:[1,9],fals:[7,10],fashion:[1,5],favor:1,fax:20,fax_sender_servic:20,faxsenderservic:20,featur:3,feedback:2,few:5,file:[7,10,15],filter:7,finish:17,first:[1,7],fix:1,follow:2,foo:[5,7,10,15,19],foo_factori:7,fork:2,form:2,format:2,found:7,framework:[5,11,12,15],friendli:5,from:[1,5,7,10,11,12,13,14,15,17,18,19,20,21,22],func:7,func_parti:[],futur:7,gener:[1,7],github:0,given:[7,10],global:7,grasp:11,group:[1,7,20],guidelin:2,happen:1,hard:2,heart:5,hello:20,hint:5,how:[7,10,11,12,14,17,18,19,21,22],http:[0,14],human:3,idea:11,identifi:7,illustr:[3,11,16],illustrative_exampl:15,illustrativeexampl:15,imposs:7,includ:[1,2],inclus:10,independ:11,index:3,indic:[7,9],infer:1,inform:7,initi:[1,5,7],inject:[1,3,4,6,11,12,13,14,15,16,18,20,21,22],inject_multipl:[1,7],injectable_factori:[1,7,14],injectable_factory_decor:14,injectableloaderror:7,injection_contain:[],injectioncontain:[1,7],injectioncontainernotloadederror:[],injectionerror:[7,9],insid:7,inspect:1,instal:[1,3],instanc:[5,7,11,20],instanti:[1,7],instead:[1,7],invoc:7,invok:7,isn:7,issu:2,its:21,itself:[2,7],just:5,kafkaproduc:5,keep:2,kind:2,klass:10,lambda:[10,22],last:7,lazi:[1,3,5,7,12,16],lazy_inject:17,lazy_object_proxi:1,lazy_servic:17,lazyinject:17,lazyservic:17,learn:[12,20],least:[7,10],level:7,licens:5,like:5,line:4,linter:[2,5],list:[1,5,7,19,20],load:[1,7],load_injection_contain:[1,5,7,11,12,13,14,15,17,18,19,20,21,22],local:[],locat:1,log:7,look:7,lookup:7,love:3,low:7,maco:1,made:7,magic:[2,7],mai:2,main:[11,12,13,14,17,18,19,20,21],make:[1,2,5,7,11,12,13,14,15,17,18,19,20,21,22],manag:7,mani:5,manual:10,mark:[1,7],martin:0,master:2,match:7,meant:7,messag:[5,12,20],message_a:12,message_b:12,message_brok:5,method:[1,7,11],mind:2,minihan:0,minor:1,miss:1,mock:[1,10,22],mocked_dep:22,mocked_inject:22,mockeddep:22,model:5,modul:[1,3,7],more:[1,7],multipl:[1,3,7,16,20],multiplenamespac:18,multipli:13,multiply_servic:13,multiplyservic:13,must:7,name:1,namespac:[1,3,5,7,8,10,16],necessari:7,need:[2,7,10],never:7,nevertheless:2,non:7,none:[7,10,19],odd:18,odd_count:18,odd_counter_servic:18,oddcounterservic:18,offici:1,often:2,old:20,oliveira:0,onc:[1,7],one:[7,10,22],ones:7,onli:[5,7],open:2,option:[1,3,7,10,16],optionalinject:19,organ:2,origin:5,other:[7,11],otherwis:10,our:[5,11],out:[5,7],output:1,outsid:7,overload:[3,5,16],own:[],packag:[1,5],page:3,paramet:[1,5,7,10],parameter_valid:[],parameter_validation_decor:[],parameters_valid:[],parenthesi:[1,7],pass:[5,7],path:[1,5,7],pend:5,perform:7,pip:[1,4],place:7,posit:7,possibl:1,preced:[3,16],present:7,preserv:5,prevent:7,previou:[1,7],previous:7,primari:[7,13],print:[11,12,13,14,15,17,18,19,20,21,22],project:[2,5],propag:10,properti:[12,21],provid:[1,10],pull:2,purpos:7,pycharm:5,python:[1,7,15],qualifi:[1,3,5,7,10,12,13,14,16,18],qualifier_overload:20,qualifieroverload:20,quirk:1,rais:[1,7,9,10,14],readabl:2,readi:5,realdep:22,reason:7,receiv:[2,7],recipi:20,recommend:7,record:10,recurs:10,refactor:1,refer:[3,12],regard:7,regardless:7,regist:[1,7,8,10],register_inject:[10,22],registri:7,rel:[1,7],releas:1,remov:[1,7],repositori:2,request:[2,7],requir:1,reset:10,reset_injection_contain:[1,10],resili:1,resolut:7,resolv:7,respect:7,retrieve_pending_messag:5,review:2,rodrigo:0,root:5,rst:[],run:[1,2,11,12,13,14,15,17,18,19,20,21,22],runtimeerror:14,same:[1,5,7],scan:[1,7,10],search:[1,3,7,8],search_path:7,section:[7,10],see:[13,14,17,18,19,21],self:[5,7,11,12,13,14,15,17,18,19,20,21,22],send:20,send_messag:20,send_pend:5,sender_servic:20,senderservic:20,sequenc:7,servic:[1,5,7,11,13,20,21],service_a:12,service_b:12,servicea:12,serviceb:12,set:10,setter:21,setup:7,shall:7,share:[5,7],should:7,shouldn:7,show:10,side_effect:22,signatur:1,simpl:5,simple_servic:11,simple_singleton:21,simpleservic:11,simplesingleton:21,sinc:7,singl:[5,15],singleton:[3,5,7,16],sms_sender_servic:20,smssenderservic:20,some:[],some_servic:19,someth:17,sourc:[7,9,10],speak:2,specif:7,specifi:[5,7,10],sqsproduc:5,stabl:1,staticmethod:22,still:7,store:7,str:[7,10,14,20],string:[1,7],style:2,submit:2,subsect:[],success:7,suit:1,suitabl:1,sum:13,sum_servic:13,sumservic:13,support:1,sure:7,take:20,test:[1,2,3,5,6,7,11,12,13,14,15,16,17,18,19,20,21],testing_exampl:22,testingexampl:22,than:[1,2,7],them:5,themselv:7,thi:[2,7,10,11,12,13,14,15,17,18,19,20,21,22],thoroughli:2,though:7,through:1,time:[1,7],ton:1,trail:7,transpar:5,trial:1,tricki:2,turn:[],type:[1,5,7,10,11,19,20],typeerror:1,ubuntu:1,unabl:7,under:7,union:[7,10],uniqu:7,unique_id:7,unit:[1,2],unittest:22,unknown:14,unless:10,unus:1,usag:[1,3,7,10,15],use:[1,2,5,7,10,13,14,18,22],used:[5,7,8],using:[1,7,11,19],util:[1,7,10,22],uuid:7,valid:7,validation_parti:[],valu:[7,21],valueerror:10,varieti:7,version:[7,10],wai:2,want:2,warn:7,wasn:7,welcom:2,well:2,what:2,when:[1,5,7,10],whenev:[],where:7,which:[1,7,10],whoch:[],window:1,wire:7,without:[1,7],won:10,work:1,world:20,wrap:[7,22],write:2,wrote:2,you:[2,3,11,12,13,14,17,18,19,20,21],your:[2,5]},titles:["Authors","Changelog","Contributing","Contents","Installation","Injectable: Dependency Injection for Humans\u2122","Reference","injectable","injectable.constants","injectable.errors","injectable.testing","Basic Usage Example","Cyclic Dependency Example","Dependencies Precedence Example","Factory Example","Illustrative Example","Usage Examples","Lazy Injection Example","Multiple Namespaces Example","Optional Injection Example","Qualifier Overloading Example","Singletons Example","Testing Example"],titleterms:{author:0,basic:11,changelog:1,constant:8,content:3,contribut:2,cyclic:12,depend:[5,12,13],error:9,exampl:[11,12,13,14,15,16,17,18,19,20,21,22],factori:14,featur:5,human:5,illustr:15,indic:3,inject:[5,7,8,9,10,17,19],instal:4,lazi:17,love:5,multipl:18,namespac:18,option:19,overload:20,preced:13,qualifi:20,refer:6,singleton:21,tabl:3,test:[10,22],usag:[11,16],you:5}}) \ No newline at end of file diff --git a/docs/usage/basic_usage.html b/docs/usage/basic_usage.html index 3da9f53..11624dc 100644 --- a/docs/usage/basic_usage.html +++ b/docs/usage/basic_usage.html @@ -3,7 +3,7 @@ - Basic Usage Example — injectable 3.4.0 documentation + Basic Usage Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

    Navigation

    @@ -212,8 +212,8 @@

    Navigation

    \ No newline at end of file diff --git a/docs/usage/cyclic_dependency.html b/docs/usage/cyclic_dependency.html index e1c9728..9df6c59 100644 --- a/docs/usage/cyclic_dependency.html +++ b/docs/usage/cyclic_dependency.html @@ -3,7 +3,7 @@ - Cyclic Dependency Example — injectable 3.4.0 documentation + Cyclic Dependency Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

    Navigation

    @@ -190,8 +190,8 @@

    Navigation

    \ No newline at end of file diff --git a/docs/usage/dependencies_precedence.html b/docs/usage/dependencies_precedence.html index eb8646e..f3bd36a 100644 --- a/docs/usage/dependencies_precedence.html +++ b/docs/usage/dependencies_precedence.html @@ -3,7 +3,7 @@ - Dependencies Precedence Example — injectable 3.4.0 documentation + Dependencies Precedence Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

    Navigation

    @@ -202,8 +202,8 @@

    Navigation

    \ No newline at end of file diff --git a/docs/usage/factory.html b/docs/usage/factory.html index 3d0e610..90d6a9e 100644 --- a/docs/usage/factory.html +++ b/docs/usage/factory.html @@ -3,7 +3,7 @@ - Factory Example — injectable 3.4.0 documentation + Factory Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

    Navigation

@@ -207,8 +207,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/illustrative_example.html b/docs/usage/illustrative_example.html index 1385ca5..4f6e960 100644 --- a/docs/usage/illustrative_example.html +++ b/docs/usage/illustrative_example.html @@ -3,7 +3,7 @@ - Illustrative Example — injectable 3.4.0 documentation + Illustrative Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -156,8 +156,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/index.html b/docs/usage/index.html index ef22f86..3f48233 100644 --- a/docs/usage/index.html +++ b/docs/usage/index.html @@ -3,7 +3,7 @@ - Usage Examples — injectable 3.4.0 documentation + Usage Examples — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -138,8 +138,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/lazy_injection.html b/docs/usage/lazy_injection.html index 7470bac..e1962bd 100644 --- a/docs/usage/lazy_injection.html +++ b/docs/usage/lazy_injection.html @@ -3,7 +3,7 @@ - Lazy Injection Example — injectable 3.4.0 documentation + Lazy Injection Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -172,8 +172,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/multiple_namespaces.html b/docs/usage/multiple_namespaces.html index a12aa5f..ea06027 100644 --- a/docs/usage/multiple_namespaces.html +++ b/docs/usage/multiple_namespaces.html @@ -3,7 +3,7 @@ - Multiple Namespaces Example — injectable 3.4.0 documentation + Multiple Namespaces Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -189,8 +189,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/optional_injection.html b/docs/usage/optional_injection.html index 64784ac..7205837 100644 --- a/docs/usage/optional_injection.html +++ b/docs/usage/optional_injection.html @@ -3,7 +3,7 @@ - Optional Injection Example — injectable 3.4.0 documentation + Optional Injection Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -160,8 +160,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/qualifier_overloading.html b/docs/usage/qualifier_overloading.html index 56ad92d..8bee2ff 100644 --- a/docs/usage/qualifier_overloading.html +++ b/docs/usage/qualifier_overloading.html @@ -3,7 +3,7 @@ - Qualifier Overloading Example — injectable 3.4.0 documentation + Qualifier Overloading Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -211,8 +211,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/singletons.html b/docs/usage/singletons.html index a2bc0fc..126f261 100644 --- a/docs/usage/singletons.html +++ b/docs/usage/singletons.html @@ -3,7 +3,7 @@ - Singletons Example — injectable 3.4.0 documentation + Singletons Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -196,8 +196,8 @@

Navigation

\ No newline at end of file diff --git a/docs/usage/testing_example.html b/docs/usage/testing_example.html index 66fb938..6570ecd 100644 --- a/docs/usage/testing_example.html +++ b/docs/usage/testing_example.html @@ -3,7 +3,7 @@ - Testing Example — injectable 3.4.0 documentation + Testing Example — injectable 3.4.1 documentation @@ -30,7 +30,7 @@

Navigation

@@ -173,8 +173,8 @@

Navigation

\ No newline at end of file diff --git a/injectable/autowiring/autowired_decorator.py b/injectable/autowiring/autowired_decorator.py index b471617..30fd86f 100644 --- a/injectable/autowiring/autowired_decorator.py +++ b/injectable/autowiring/autowired_decorator.py @@ -69,10 +69,10 @@ def wrapper(*args, **kwargs): if parameter.name in bound_arguments: continue dependency = parameter.annotation.inject() - if parameter.kind is parameter.KEYWORD_ONLY: - kwargs[parameter.name] = dependency - else: + if parameter.kind is parameter.POSITIONAL_ONLY: args.append(dependency) + else: + kwargs[parameter.name] = dependency return func(*args, **kwargs) diff --git a/setup.py b/setup.py index 74e1633..cc5d8a2 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def read(*names, **kwargs): setup( name="injectable", - version="3.4.0", + version="3.4.1", packages=find_packages( exclude=( "tests", diff --git a/tests/fixes/issue_15/issue_15_fix_test.py b/tests/fixes/issue_15/issue_15_fix_test.py new file mode 100644 index 0000000..ba49df6 --- /dev/null +++ b/tests/fixes/issue_15/issue_15_fix_test.py @@ -0,0 +1,28 @@ +""" +Test the fix for the issue 15: +Using named args breaks injectable +https://github.com/allrod5/injectable/issues/15 + +Injectable 3.4.0 attempted to always inject autowired parameters as positional args +which may result in passing a duplicated parameter when the caller passes a +non-keyword-only parameter as named arg. + +This issue was fixed in injectable 3.4.1. +""" +from injectable import injectable, autowired, Autowired, load_injection_container + + +@injectable +class Foo: + pass + + +@autowired +def bar(qux, foo: Autowired(Foo)): + assert qux == "QUX" + assert foo is not None + + +def test_issue_15_fix(): + load_injection_container() + bar(qux="QUX") diff --git a/tests/unit/autowiring/autowired_decorator_unit_test.py b/tests/unit/autowiring/autowired_decorator_unit_test.py index 7778082..320f11c 100644 --- a/tests/unit/autowiring/autowired_decorator_unit_test.py +++ b/tests/unit/autowiring/autowired_decorator_unit_test.py @@ -164,3 +164,24 @@ def f(a: AutowiredMockA, b: AutowiredMockB, c: AutowiredMockC): assert parameters["a"] is None assert parameters["b"] is AutowiredMockB.inject() assert parameters["c"] is None + + def test__autowired__with_named_args_defined_by_the_caller(self): + # given + AutowiredMockA = MagicMock(spec=_Autowired) + AutowiredMockB = MagicMock(spec=_Autowired) + AutowiredMockC = MagicMock(spec=_Autowired) + + @autowired + def f(a: AutowiredMockA, b: AutowiredMockB, c: AutowiredMockC): + return {"a": a, "b": b, "c": c} + + # when + parameters = f(None, b=None) + + # then + assert AutowiredMockA.inject.called is False + assert AutowiredMockB.inject.called is False + assert AutowiredMockC.inject.called is True + assert parameters["a"] is None + assert parameters["b"] is None + assert parameters["c"] is AutowiredMockC.inject() diff --git a/tests/unit/python_3_8_only/__init__.py b/tests/unit/python_3_8_only/__init__.py new file mode 100644 index 0000000..28cfa68 --- /dev/null +++ b/tests/unit/python_3_8_only/__init__.py @@ -0,0 +1,5 @@ +import sys +import pytest + +if sys.version_info[:2] < (3, 8): + pytest.skip("Skipping Python 3.8+-only tests", allow_module_level=True) diff --git a/tests/unit/python_3_8_only/autowiring/__init__.py b/tests/unit/python_3_8_only/autowiring/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit/python_3_8_only/autowiring/autowired_decorator_py38_unit_test.py b/tests/unit/python_3_8_only/autowiring/autowired_decorator_py38_unit_test.py new file mode 100644 index 0000000..ec44f9b --- /dev/null +++ b/tests/unit/python_3_8_only/autowiring/autowired_decorator_py38_unit_test.py @@ -0,0 +1,32 @@ +from unittest.mock import MagicMock + +from injectable import autowired +from injectable.autowiring.autowired_type import _Autowired + + +class TestAutowiredDecoratorPy38: + def test__autowired__with_positional_only_args(self): + # given + AutowiredMockA = MagicMock(spec=_Autowired) + AutowiredMockB = MagicMock(spec=_Autowired) + AutowiredMockC = MagicMock(spec=_Autowired) + + @autowired + def f( + a: AutowiredMockA, + /, # noqa: E999, E225 + b: AutowiredMockB, + c: AutowiredMockC, + ): + return {"a": a, "b": b, "c": c} + + # when + parameters = f(b=None) + + # then + assert AutowiredMockA.inject.called is True + assert AutowiredMockB.inject.called is False + assert AutowiredMockC.inject.called is True + assert parameters["a"] is AutowiredMockA.inject() + assert parameters["b"] is None + assert parameters["c"] is AutowiredMockC.inject()