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

Re-implement command-line parameters and environment variables as ConfigArgParse interface #96

Open
gdevenyi opened this issue May 12, 2016 · 9 comments
Labels
Milestone

Comments

@gdevenyi
Copy link
Member

Right now we allow defaults via the environment.

@andrewjankie makes a passing mention of config file defaults

@pipitone
Copy link
Collaborator

pipitone commented May 12, 2016 via email

@gdevenyi
Copy link
Member Author

Just kinda worried about the proliferation of environment variables.

I'm just thinking about how to handle all cases of defaults for the "I don't want to type this every day" type

@gdevenyi
Copy link
Member Author

If we ever do consider it https://docs.python.org/2/library/configparser.html

@gdevenyi
Copy link
Member Author

gdevenyi commented Jun 8, 2016

As an alternative to "environment-variables" support, we could do what pydpiper does, which is define a "default" config file via an ENV var. This would reduce the env var set to one.

@pipitone
Copy link
Collaborator

pipitone commented Jun 9, 2016

And so in the environment-modules file you could do something like:

set-env  QBATCH_CONFIG  /quarantine/qbatch/1.01/build/config

I'm okay with that. I also don't see a compelling case to change from
using environment variables. What do you have in mind?

@gdevenyi
Copy link
Member Author

gdevenyi commented Jun 9, 2016

I can see a case for allowing 'most' of our command line arguments to have settable defaults. This presents an explosion of environment variables. If future options come this could continue.

A config file would collapse all these info one, and allow for documentation of options inside the config file.

@pipitone
Copy link
Collaborator

Right, I see what you mean. I'm weirdly attached to the convenience of
env variables but no matter... config file does the trick nicely.

@gdevenyi gdevenyi added this to the sometime milestone Jun 10, 2016
@gdevenyi
Copy link
Member Author

It'll be a fairly big piece of work to transform all our options to configparser so I'll stick a "sometime" on this.

@gdevenyi gdevenyi changed the title Do we want a config file? Re-implement defaults as a configparser interface Jun 10, 2016
@gdevenyi gdevenyi changed the title Re-implement defaults as a configparser interface Re-implement command-line parameters as ConfigArgParse interface Aug 13, 2016
@gdevenyi
Copy link
Member Author

Looks like ConfigArgParse is ideal.

Mostly drop-in replacement for ArgParse, with config file and environment variable features in one set:
https://github.com/bw2/ConfigArgParse

@gdevenyi gdevenyi changed the title Re-implement command-line parameters as ConfigArgParse interface Re-implement command-line parameters and environment variables as ConfigArgParse interface Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants