qbatch
qbatch copied to clipboard
Re-implement command-line parameters and environment variables as ConfigArgParse interface
Right now we allow defaults via the environment.
@andrewjankie makes a passing mention of config file defaults
Hm.. Needlessly complex? What was the use case you had in mind?
Either way, we definitely still want configuration via environment variables so that we can use qbatch with environment-modules.
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
If we ever do consider it https://docs.python.org/2/library/configparser.html
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.
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?
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.
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.
It'll be a fairly big piece of work to transform all our options to configparser so I'll stick a "sometime" on this.
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