Skip to content

Feature/dotenv loading#42

Merged
GDWR merged 10 commits into
GDWR:mainfrom
fisher60:feature/dotenv-loading
May 8, 2022
Merged

Feature/dotenv loading#42
GDWR merged 10 commits into
GDWR:mainfrom
fisher60:feature/dotenv-loading

Conversation

@fisher60
Copy link
Copy Markdown
Contributor

@fisher60 fisher60 commented May 6, 2022

No description provided.

fisher60 added 3 commits May 6, 2022 13:32
I have added the env var loader as well as tests. The loader will not override any system environment variables, so system env vars are prioritized over the ones passed into the loader. This is consistent with python-dotenv's methods.

Currently tests cover that env vars in a .env file that is passed to the autoloader will load the correct values with the correct names. The tests do not ensure that correct env vars from the system are loaded in. The test also does not cover whether multiple configs can be loaded together using this method, but those tests should be covered elsewhere and I do not expect the env loader to interact with multiple configs in a breaking manner.
@fisher60
Copy link
Copy Markdown
Contributor Author

fisher60 commented May 6, 2022

Closes #40

Comment thread tests/test_env_parsing.py Outdated
Comment thread tests/test_env_parsing.py
Comment thread classy_config/loader/env_loader.py Outdated
fisher60 added 4 commits May 8, 2022 17:13
A filepath must always be given and will be validated by the config.register_config function. Therefore no check is needed that the filepath or file exists.
@fisher60 fisher60 requested a review from GDWR May 8, 2022 22:37
@GDWR GDWR merged commit 4486c33 into GDWR:main May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants