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