Commit 9d054e6c authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Only add internal channel if necessary

parent 0c06b380
......@@ -9,6 +9,7 @@ import os
import re
import sys
from fsl_ci.conda import get_channel_packages
from manifest_rules.utils import (load_release_info,
generate_environment_file_name,
generate_development_version_identifier)
......@@ -33,14 +34,31 @@ def filter_packages(release_info, platform, cudaver):
return otherpkgs + cudapkgs
def need_internal_channel(release_info, packages):
"""Returns True if any of the given packages are sourced from the
internal FSL conda channel.
"""
# the internal channel contains ${FSLCONDA_USERNAME}
# and ${FSLCONDA_PASSWORD}, which are assumed to be
# set in the CI environment
channel_url = op.expandvars(release_info['internal_channel'])
internal_packages = get_channel_packages(channel_url)
internal_packages = [p.name for p in internal_packages]
packages = [p.split()[0] for p in packages]
return any([p in internal_packages for p in packages])
def generate_environment(release_info, version, platform, cudaver, outfile):
"""Genereate an environment file for the platform and CUDA version.
"""
channels = list(release_info['channels'])
packages = filter_packages(release_info, platform, cudaver)
# Dev release
if version is None:
# Internal/dev release - add internal
# channel to environment spec if necessary
if need_internal_channel(release_info, packages):
channels = [release_info['internal_channel']] + channels
with open(outfile, 'wt') as f:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment