Skip to content

Commit

Permalink
Pin Python version in environment
Browse files Browse the repository at this point in the history
It seems that `conda env update` is overriding the match specification
from the previous `python` install command. To fix this, we create the
environment empty and pin the `python` version in the `pinned` file.
This should be respected by `conda env update`.
  • Loading branch information
jakirkham committed Nov 19, 2018
1 parent 4da1bae commit 9821989
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ install:
- cmd: conda config --get

# Create the test environment.
- cmd: conda create -y -n testenv python="%CONDA_PY%"
- cmd: conda env update -n testenv --file environment_ci.yml
- cmd: conda create -y -n testenv
- cmd: conda activate testenv
- cmd: echo "python %CONDA_PY%.*" >> "%CONDA_PREFIX%\\conda-meta\\pinned"
- cmd: conda env update -n testenv --file environment_ci.yml

# Skip .NET project specific build phase.
build: off
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ install:
- conda clean -tipsy

# Create the test environment.
- conda create -y -n testenv python="${PYVER}"
- conda env update -n testenv --file environment_ci.yml
- conda create -y -n testenv
- conda activate testenv
- echo "python ${PYVER}.*" >> "${CONDA_PREFIX}/conda-meta/pinned"
- conda env update -n testenv --file environment_ci.yml

# command to run tests, e.g. python setup.py test
script:
Expand Down

0 comments on commit 9821989

Please sign in to comment.