-
Notifications
You must be signed in to change notification settings - Fork 60
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
conda_mirror.py: set additional parameters from config-file... #74
Conversation
…ping ability to override from command line
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
==========================================
- Coverage 93.89% 92.11% -1.78%
==========================================
Files 2 2
Lines 262 279 +17
==========================================
+ Hits 246 257 +11
- Misses 16 22 +6
Continue to review full report at Codecov.
|
Seems like the PR was a bit premature - the arguments that have default values set to something that does not evaluate to False are not overridden by values in the config file. Like temp_directory. |
conda_mirror.py: added command line swith: --no-validate-target
Handle download errors
After some interesting merges and some fixup, the change/pr should be good to go now. |
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.
Sorry for the delay in reviewing. There's been a request to cut a 0.8.0 release. We can get this included with a couple minor modifications.
# ignore values that can only be given on command line | ||
(a.dest not in {'config', 'verbose', 'version'}) and | ||
# only use config file value if the value was not explicitly given on command line | ||
(not given_args.__contains__(a.dest)) |
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.
(not given_args.__contains__(a.dest)) | |
(a.dist not in given_args) |
@@ -220,6 +220,8 @@ def _parse_and_format_args(): | |||
""" | |||
parser = _make_arg_parser() | |||
args = parser.parse_args() | |||
# parse arguments without setting defaults | |||
given_args, foo = parser._parse_known_args(sys.argv[1:], argparse.Namespace()) |
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.
given_args, foo = parser._parse_known_args(sys.argv[1:], argparse.Namespace()) | |
given_args, _ = parser._parse_known_args(sys.argv[1:], argparse.Namespace()) |
Change of plans: I'll merge this and fix the two style nits in the release PR. |
… while keeping ability to override from command line.
With this change config.yaml can contain most command line parameters and you can have a config file like
If parameters are both found in the config file and in the given command line arguments, the latter will take precedence.
Now you can simply call conda-mirror with --config