vericast / conda-mirror

Mirror upstream conda channels
BSD 3-Clause "New" or "Revised" License
71 stars 59 forks source link

conda_mirror.py: set additional parameters from config-file... #74

Closed magnuhho closed 5 years ago

magnuhho commented 5 years ago

… 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

target_directory: "/conda-mirror/conda-forge"
temp_directory: "/tmp"
platform: linux-64
upstream_channel: conda-forge
dry_run: True
blacklist:
  - name: "*"
whitelist:
  - name: ca-certificates

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

codecov-io commented 5 years ago

Codecov Report

Merging #74 into master will decrease coverage by 1.77%. The diff coverage is 80%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
conda_mirror/conda_mirror.py 92.02% <80%> (-1.8%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 96bad91...1b6e1b6. Read the comment docs.

magnuhho commented 5 years ago

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. I'll look into it

magnuhho commented 5 years ago

After some interesting merges and some fixup, the change/pr should be good to go now.

parente commented 5 years ago

Change of plans: I'll merge this and fix the two style nits in the release PR.