diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-05-08 13:45:15 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-05-08 13:45:15 -0400 |
commit | 2c9df013295bb5464eaab028b4ad1c997a5552e8 (patch) | |
tree | ad780065f7811a5393175be38928e6a5f7dff1dc /delivery_merge/conda.py | |
parent | 00ad428894d65857bb85ee99d3deff578c69faf3 (diff) | |
download | delivery_merge-2c9df013295bb5464eaab028b4ad1c997a5552e8.tar.gz |
Add channel argument generator
Diffstat (limited to 'delivery_merge/conda.py')
-rw-r--r-- | delivery_merge/conda.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/delivery_merge/conda.py b/delivery_merge/conda.py index 44e15de..09c19a2 100644 --- a/delivery_merge/conda.py +++ b/delivery_merge/conda.py @@ -120,3 +120,16 @@ def conda(*args): :returns: subprocess.CompletedProcess object """ return sh('conda', *args) + + +def conda_cmd_channels(conda_channels, override=True): + """ Generate conda command arguments for handling channels + :param conda_channels: list: URI to channel + :param override: bool: channel order is preserved when True + """ + assert isinstance(conda_channels, list) + channels_result = '--override-channels ' if override else '' + for channel in conda_channels: + channels_result += f'-c {channel} ' + + return channels_result |