Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Python 2.7 conda environment #795

Merged
merged 9 commits into from
Apr 20, 2021
Merged
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.6 fipy"
python: "python=3"
packages: "fipy"
condaenv: "test-environment-36"

pip_env:
Expand Down