Skip to content

Config providers #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rmk135 opened this issue Jan 27, 2015 · 0 comments
Closed

Config providers #1

rmk135 opened this issue Jan 27, 2015 · 0 comments
Assignees

Comments

@rmk135
Copy link
Member

rmk135 commented Jan 27, 2015

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')))
@rmk135 rmk135 self-assigned this Jan 27, 2015
@rmk135 rmk135 modified the milestone: 0.3 Jan 27, 2015
@rmk135 rmk135 closed this as completed Jan 27, 2015
rmk135 added a commit that referenced this issue Oct 27, 2020
rmk135 added a commit that referenced this issue Oct 19, 2021
rmk135 added a commit that referenced this issue Oct 20, 2021
* Add GA test and linter jobs

* Remove not used async run() functions from tests

* Update aiohttp ext test

* Add botocore warning ignores

* Update changelog

* Update publishing job config for testing

* Publishing test #1

* Update GA tests-and-linters job to use latest ubuntu for tests

* Update publishing GA job
ZipFile pushed a commit that referenced this issue Feb 1, 2025
Allow Closing to detect dependent resources passed as kwargs too #636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant