-
Notifications
You must be signed in to change notification settings - Fork 442
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
Draft: Allow reading from environment variables for options #1577
Conversation
please provide update for DOCUMENTATION.md and also if possible create some test cases |
@pbiering Will do. Where should I put the test, and also, would you like me to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There is a test subdirectory, check whether you can copy+adjust one or more |
Not quite sure how to do the test. I need to set an environment variable before the test server starts. |
potentially there is a way to set environment variable in Python before calling the function. |
The problem is that the setup function is called before any test is run I think. I was thinking of putting it in |
would it not possible to copy and adjust |
@pbiering I think it should be good now if you wanna take a look. |
Generally it looks good but your test case leads me to that it would be not safe for options which have My original proposal was like And looks like I had forgotten to mention the reason behind the Please check and adjust/extend code and also test cases like
|
Made a PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@poperigby : code approved but tests partially failed, please investigate, thank you! |
@pbiering That's bizarre I don't remember making the comment about making a PR. Must have been a mistake. As for using a double underscore, yeah I'll fix that. The test seems to be failing because the test environment is using an older version of Python that doesn't have |
@poperigby : yes,
|
@poperigby while working on another issue it came into my mind why not using the command line options which fully support all all options of the config file and have precedence. There are two ways support, example:
Can this also help in your case, because then no extension would be required at all. |
Yeah that's definitely an option, although it's certainly not as nice looking or easy to write as environment variable versions of options. |
there is also a 3rd method
requires no additional support and one can take the options directly from the online help and does not need to replace |
@poperigby are you satisfied already with the existing capabilities as described? Then your PR would not be needed. |
Yes I suppose that would work. |
I need to test this but it should work.