Skip to content
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

[FEATURE-115] adds PATH_TO_CONFIG env var to provide configuration outside of module/repository #143

Merged
merged 2 commits into from
May 31, 2021

Conversation

apoclyps
Copy link
Owner

@apoclyps apoclyps commented May 31, 2021

What's Changed

adds PATH_TO_CONFIG env var to provide configuration outside of module/repository and adds PATH_TO_CONFIG to config command:

image

implements #115

Technical Description

Reads PATH_TO_CONFIG from the environment if provided and configures decouple using AutoConfig with the search_path set to use PATH_TO_CONFIG as a value.

Steps to reproduce

The following steps are used to test the configuration using .env and .ini files from within the module/repository (default location set by decouple) and a location specified by an env var.

# defaults to `apoclyps/reviews`
unset REPOSITORY_CONFIGURATION

image

Testing .env file within the repository

cd /home/apoclyps/workspace/apoclyps/reviews
touch .env
echo "REPOSITORY_CONFIGURATION=python/typeshed" >> .env
python -m reviews config

image

rm .env

Testing .ini file within the repository

cd /home/apoclyps/workspace/apoclyps/reviews
touch settings.ini
echo "[settings]\nREPOSITORY_CONFIGURATION=python/typeshed" >> settings.ini
python -m reviews config

image

rm settings.ini

Testing using PATH_TO_CONFIG

cd /home/apoclyps/
touch settings.ini
echo "[settings]\nREPOSITORY_CONFIGURATION=python/typeshed" >> settings.ini
cd /home/apoclyps/workspace/apoclyps/reviews
export PATH_TO_CONFIG=/home/apoclyps/
python -m reviews config

image

@apoclyps apoclyps added python Pull requests that update Python code enhancement New feature or request labels May 31, 2021
@apoclyps apoclyps merged commit 82d26f9 into main May 31, 2021
@apoclyps apoclyps deleted the kyleharrison/feature-115/config-via-files branch May 31, 2021 10:46
@apoclyps apoclyps added this to Release Candidate in 0.2.0 May 31, 2021
@apoclyps apoclyps moved this from Release Candidate to Done in 0.2.0 Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
No open projects
0.2.0
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant