99#
1010container :
1111 image : python:3.8
12+ cpu : 2
13+ memory : 4G
1214
1315env :
1416 # Maximum cache period (in weeks) before forcing a new cache upload.
1820 # Increment the build number to force new stratify cache upload.
1921 STRATIFY_CACHE_BUILD : " 0"
2022 # Base environment conda packages to be installed.
21- MAMBA_CACHE_PACKAGES : " pip conda-lock"
23+ MAMBA_CACHE_PACKAGES : " conda-lock"
2224 # Enable Cython code coverage.
2325 CYTHON_COVERAGE : " 1"
26+ # Increment the build number to force new pip cache upload.
27+ PIP_CACHE_BUILD : " 0"
28+
29+
30+ #
31+ # Linting
32+ #
33+ lint_task :
34+ auto_cancellation : true
35+ name : " ${CIRRUS_OS}: black, flake8 and isort"
36+ pip_cache :
37+ folder : ~/.cache/pip
38+ fingerprint_script :
39+ - echo "${CIRRUS_TASK_NAME}"
40+ - echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${PIP_CACHE_BUILD}"
41+ lint_script :
42+ - pip list
43+ - python -m pip install --editable .[lint]
44+ - pip list
45+ - black .
46+ - flake8 .
47+ - isort .
48+
2449
2550#
2651# Testing (Linux)
@@ -33,7 +58,7 @@ linux_task:
3358 env :
3459 PY_VER : " 3.9"
3560 COVERAGE : " 1"
36- name : " Linux : py${PY_VER}"
61+ name : " ${CIRRUS_OS} : py${PY_VER}"
3762 container :
3863 image : gcc:latest
3964 env :
@@ -69,53 +94,6 @@ linux_task:
6994 - source ${HOME}/mambaforge/etc/profile.d/conda.sh >/dev/null 2>&1
7095 - conda activate py${PY_VER} >/dev/null 2>&1
7196 - python setup.py build_ext --inplace
72- - pip install --no-deps --editable .
97+ - python -m pip install --no-deps --editable .
7398 - if [ -n "${COVERAGE}" ]; then pytest --cov-report=xml --cov; else pytest; fi
7499 - if [ -n "${COVERAGE}" ]; then codecov; fi
75-
76- #
77- # Testing (macOS)
78- #
79- osx_task :
80- auto_cancellation : true
81- matrix :
82- env :
83- PY_VER : " 3.8"
84- name : " OSX: py${PY_VER}"
85- osx_instance :
86- image : catalina-xcode
87- env :
88- PATH : ${HOME}/mambaforge/bin:${PATH}
89- mamba_cache :
90- folder : ${HOME}/mambaforge
91- fingerprint_script :
92- - wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh -O mambaforge.sh
93- - echo "${CIRRUS_OS} $(shasum -a 256 mambaforge.sh)"
94- - echo "${MAMBA_CACHE_PACKAGES}"
95- - echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${MAMBA_CACHE_BUILD}"
96- populate_script :
97- - bash mambaforge.sh -b -p ${HOME}/mambaforge
98- - conda config --set always_yes yes --set changeps1 no
99- - conda config --set show_channel_urls True
100- - conda config --add channels conda-forge
101- - conda install --quiet --name base ${MAMBA_CACHE_PACKAGES}
102- check_script :
103- - conda info --all
104- - conda list --name base
105- stratify_cache :
106- folder : ${HOME}/mambaforge/envs/py${PY_VER}
107- fingerprint_script :
108- - echo "${CIRRUS_OS} py${PY_VER} tests"
109- - echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${STRATIFY_CACHE_BUILD}"
110- - cat ${CIRRUS_WORKING_DIR}/requirements/py$(echo ${PY_VER} | tr -d ".").yml
111- populate_script :
112- - conda-lock --mamba --platform osx-64 --file ${CIRRUS_WORKING_DIR}/requirements/py$(echo ${PY_VER} | tr -d ".").yml
113- - mamba create --yes --name py${PY_VER} --quiet --file conda-osx-64.lock
114- - cp conda-osx-64.lock ${HOME}/mambaforge/envs/py${PY_VER}
115- test_script :
116- - cat ${HOME}/mambaforge/envs/py${PY_VER}/conda-osx-64.lock >&2
117- - source ${HOME}/mambaforge/etc/profile.d/conda.sh >/dev/null 2>&1
118- - conda activate py${PY_VER} >/dev/null 2>&1
119- - python setup.py build_ext --inplace
120- - pip install --no-deps --editable .
121- - pytest
0 commit comments