Commit ef9d9df7 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'rf/base-packages' into 'master'

RF: Read base_packages list from release.yml, and add to manifest files

See merge request fsl/conda/manifest-rules!28
parents adae3828 0054e0a6
#!/usr/bin/env python
__version__ = '0.4.11'
__version__ = '0.5.0'
......@@ -167,9 +167,10 @@ def generate_version_section(version,
version, platform, cuda = parse_environment_file_name(envfile)
build = {
'platform' : platform,
'environment' : url,
'sha256' : checksum
'platform' : platform,
'environment' : url,
'sha256' : checksum,
'base_packages' : release_info['base_packages']
}
if cuda is not None:
build['cuda'] = cuda
......
......@@ -67,6 +67,7 @@ def full_test(envfile, release_info):
platform = parse_environment_file_name(envfile)[1]
miniconda_url = release_info['miniconda'][platform]
base_packages = release_info['base_packages']
download_file(miniconda_url, 'miniconda.sh')
......@@ -74,21 +75,24 @@ def full_test(envfile, release_info):
preprocess_environment(envfile, 'fsl', True)
basever = None
basepkgs = {}
with open(envfile, 'rt') as f:
for line in f:
if line.strip().startswith('- fsl-base'):
basever = line.strip().split()[2]
break
for pkg in base_packages:
if line.strip().startswith(f'- {pkg}'):
pkgver = line.strip().split(maxsplit=2)[2]
basepkgs[pkg] = pkgver.replace(' ', '=')
env = os.environ.copy()
env = os.environ.copy()
env['CONDARC'] = op.abspath(op.join('fsl', 'condarc'))
if basever is None:
if len(basepkgs) == 0:
env_out = ''
else:
env_out = sprun(f'./fsl/bin/conda install -y '
f'-n base fsl-base={basever}')
basepkgs = [f'{pkg}={ver}' for pkg, ver in basepkgs.items()]
basepkgs = ' '.join(basepkgs)
env_out = sprun(f'./fsl/bin/conda install -y -n base {basepkgs}',
env=env)
env_out += sprun(f'./fsl/bin/conda env update -n base -f {envfile}',
env=env)
......
Markdown is supported
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