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

Merge branch 'mnt/version-match' into 'master'

MNT: Use double-equals for exact version matching when passing base package versions to conda install

See merge request fsl/conda/installer!33
parents 2922f9d0 eadabaf1
......@@ -50,7 +50,7 @@ log = logging.getLogger(__name__)
__absfile__ = op.abspath(__file__).rstrip('c')
__version__ = '1.7.2'
__version__ = '1.7.3'
"""Installer script version number. This must be updated
whenever a new version of the installer script is released.
"""
......@@ -1264,6 +1264,10 @@ def download_fsl_environment(ctx):
# form:
#
# - <package> <version> [<build_variant>]
#
# From this we create a dict of the form:
#
# - <package> : <version>[=<build_variant>]
for pkg in basepkgnames:
if line.strip().startswith('- {} '.format(pkg)):
pkgver = line.strip().split(' ', 2)[2]
......@@ -1435,7 +1439,7 @@ def install_fsl(ctx):
commands = []
if ctx.fsl_base_packages is not None and len(ctx.fsl_base_packages) > 0:
basepkgs = ctx.fsl_base_packages
basepkgs = ['{}={}'.format(pkg, ver) for pkg, ver in basepkgs.items()]
basepkgs = ['{}=={}'.format(pkg, ver) for pkg, ver in basepkgs.items()]
basepkgs = ' '.join(basepkgs)
commands.append(conda + ' install -y -n base ' + basepkgs)
commands.append(conda + ' env update -n base -f ' + ctx.environment_file)
......
......@@ -36,7 +36,7 @@ mkdir -p $prefix/etc/
prefix=$(cd $prefix && pwd)
# called like
# - conda install -y -n base fslbase=1234.0
# - conda install -y -n base fslbase==1234.0
# - conda env update -n base -f <envfile>
# - conda clean -y --all
echo "#!/usr/bin/env bash" >> $3/bin/conda
......@@ -143,7 +143,7 @@ def check_install(homedir, destdir, version):
# added by our mock conda install call
with open(op.join(destdir, 'installed'), 'rt') as f:
assert f.read().strip() == 'fsl-base=1234.0'
assert f.read().strip() == 'fsl-base==1234.0'
# added by our mock conda clean call
assert op.exists(op.join(destdir, 'cleaned'))
......
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