Skip to content

Commit

Permalink
Fix Python 2.7 conda environment (#795)
Browse files Browse the repository at this point in the history
* Switch to CircleCI miniconda3 docker image, even for Python 2.7

  miniconda2 seems to be broken, even though it hasn't changed
in a year

* Be explicit about python version

* Bump the cache

Co-authored-by: Jonathan Guyer <guyer@nist.gov>
  • Loading branch information
wd15 and guyer authored Apr 20, 2021
1 parent 1b06871 commit 77cc47f
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults2: &defaults2
<<: *defaults

docker:
- image: continuumio/miniconda2
- image: continuumio/miniconda3

defaults3: &defaults3
<<: *defaults
Expand All @@ -32,11 +32,15 @@ commands:
type: string
default: ""

python:
type: string
default: "python"

steps:
- run:
name: Create Conda Environment
command: |
conda create -v --quiet --prefix << parameters.condaenv >> --show-channel-urls --channel conda-forge << parameters.packages >> gmsh
conda create -v --quiet --prefix << parameters.condaenv >> --show-channel-urls --channel conda-forge "<< parameters.python >>" << parameters.packages >> gmsh
source activate ~/project/<< parameters.condaenv >>
conda remove --quiet --channel conda-forge --force fipy
pip install scikit-fmm
Expand Down Expand Up @@ -143,7 +147,7 @@ commands:
paths:
- /opt/conda
- /root/.cache/pip
key: v12-dependencies-{{ arch }}-<< parameters.condaenv >>
key: v13-dependencies-{{ arch }}-<< parameters.condaenv >>

restore_conda_cache:
description: "Restore cache holding conda and pip"
Expand All @@ -156,9 +160,9 @@ commands:
steps:
- restore_cache:
keys:
- v12-dependencies-{{ arch }}-<< parameters.condaenv >>
- v13-dependencies-{{ arch }}-<< parameters.condaenv >>
# fallback to using the latest cache if no exact match is found
- v12-dependencies-
- v13-dependencies-

install_dependencies:
steps:
Expand All @@ -168,7 +172,6 @@ commands:
apt-get --yes update
apt-get --yes install build-essential
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda config --remove channels defaults
remove_extracted_conda_packages:
Expand All @@ -191,6 +194,9 @@ commands:
condaenv:
type: string
default: "test-environment-27"
python:
type: string
default: "python"

steps:
# Download and cache dependencies
Expand All @@ -202,6 +208,7 @@ commands:
- createenv:
condaenv: << parameters.condaenv >>
packages: << parameters.packages >>
python: << parameters.python >>

- remove_extracted_conda_packages

Expand Down Expand Up @@ -240,15 +247,17 @@ jobs:

steps:
- install_conda_packages:
packages: "python=2.7 fipy \"traitsui<7.0.0\""
python: "python=2.7"
packages: "fipy \"traitsui<7.0.0\""
condaenv: "test-environment-27"

conda3_env:
<<: *defaults3

steps:
- install_conda_packages:
packages: "python=3 fipy pytrilinos"
python: "python=3"
packages: "fipy pytrilinos"
condaenv: "test-environment-36"

pip_env:
Expand Down

0 comments on commit 77cc47f

Please sign in to comment.