@@ -91,7 +91,7 @@ To use another loader use ``loader`` argument:
9191 import yaml
9292
9393
94- container.config.from_yaml(' config.yml' , loader = yaml.UnsafeLoader)
94+ container.config.from_yaml(" config.yml" , loader = yaml.UnsafeLoader)
9595
9696 .. note ::
9797
@@ -123,7 +123,7 @@ If you need to pass an argument to this call, use ``.from_pydantic()`` keyword a
123123
124124.. code-block :: python
125125
126- container.config.from_pydantic(Settings(), exclude = {' optional' })
126+ container.config.from_pydantic(Settings(), exclude = {" optional" })
127127
128128 .. note ::
129129
@@ -225,7 +225,7 @@ undefined environment variable that doesn't have a default value, pass argument
225225
226226.. code-block :: python
227227
228- container.config.from_yaml(' config.yml' , envs_required = True )
228+ container.config.from_yaml(" config.yml" , envs_required = True )
229229
230230 See also: :ref: `configuration-strict-mode `.
231231
@@ -270,13 +270,13 @@ Mandatory YAML file:
270270
271271.. code-block :: python
272272
273- container.config.from_yaml(' config.yaml' , required = True )
273+ container.config.from_yaml(" config.yaml" , required = True )
274274
275275 Mandatory INI file:
276276
277277.. code-block :: python
278278
279- container.config.from_ini(' config.ini' , required = True )
279+ container.config.from_ini(" config.ini" , required = True )
280280
281281 Mandatory dictionary:
282282
@@ -288,7 +288,7 @@ Mandatory environment variable:
288288
289289.. code-block :: python
290290
291- container.config.api_key.from_env(' API_KEY' , required = True )
291+ container.config.api_key.from_env(" API_KEY" , required = True )
292292
293293 See also: :ref: `configuration-strict-mode `.
294294
@@ -346,16 +346,16 @@ configuration data is undefined:
346346 config = providers.Configuration(strict = True )
347347
348348
349- if __name__ == ' __main__' :
349+ if __name__ == " __main__" :
350350 container = Container()
351351
352352 try :
353- container.config.from_yaml(' does-not_exist.yml' ) # raise exception
353+ container.config.from_yaml(" does-not_exist.yml" ) # raise exception
354354 except FileNotFoundError :
355355 ...
356356
357357 try :
358- container.config.from_ini(' does-not_exist.ini' ) # raise exception
358+ container.config.from_ini(" does-not_exist.ini" ) # raise exception
359359 except FileNotFoundError :
360360 ...
361361
@@ -365,7 +365,7 @@ configuration data is undefined:
365365 ...
366366
367367 try :
368- container.config.from_env(' UNDEFINED_ENV_VAR' ) # raise exception
368+ container.config.from_env(" UNDEFINED_ENV_VAR" ) # raise exception
369369 except ValueError :
370370 ...
371371
@@ -385,7 +385,7 @@ an undefined environment variable without a default value.
385385 .. code-block :: python
386386
387387 try :
388- container.config.from_yaml(' undefined_env.yml' ) # raise exception
388+ container.config.from_yaml(" undefined_env.yml" ) # raise exception
389389 except ValueError :
390390 ...
391391
@@ -398,11 +398,11 @@ You can override ``.from_*()`` methods behaviour in strict mode using ``required
398398 config = providers.Configuration(strict = True )
399399
400400
401- if __name__ == ' __main__' :
401+ if __name__ == " __main__" :
402402 container = Container()
403403
404- container.config.from_yaml(' config.yml' )
405- container.config.from_yaml(' config.local.yml' , required = False )
404+ container.config.from_yaml(" config.yml" )
405+ container.config.from_yaml(" config.local.yml" , required = False )
406406
407407 You can also use ``.required() `` option modifier when making an injection. It does not require to switch
408408configuration provider to strict mode.
0 commit comments