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

Configuration inheritance #36

Open
sayanarijit opened this issue May 29, 2019 · 3 comments
Open

Configuration inheritance #36

sayanarijit opened this issue May 29, 2019 · 3 comments
Labels
good first issue Good for newcomers

Comments

@sayanarijit
Copy link

With the current configuration we are extending development.ini into production.ini and test.ini.

I think a better approach would be to use production.ini as the master configuration file and inherit both development.ini and test.ini from it. With this model, we can add additional configuration for development like the [pshell] directive which is not required in production. Same for testing.

This is also the way Python's dependency management works. pip install -e '.[develop]' or pipenv install --devinstalls all the production requirements and then installs development requirements as additional dependencies.

@zupo
Copy link
Member

zupo commented May 31, 2019

Completely agree. I was a blinders-wearing-horse, copying .ini files from our internal projects when I was creating this repo and didn't stop to think which way of inheritance is better. Thanks for pointing it out!

@sayanarijit
Copy link
Author

We are now inheriting production.ini > development.ini > test.ini.

However, I think the inheritance should go like: production.ini > test.ini > development.ini.

Reason: Let's take production.ini as the master configuration to run the app.
Add some assertion to it, we get run + assert = test.
And with some debugging and coding, we get test + debug + code = develop.

e.g. https://github.com/niteoweb/pyramid-realworld-example-app/blob/master/shell.nix#L23-L26

@zupo
Copy link
Member

zupo commented Apr 20, 2020

Yep, I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants