diff --git a/.cirrus.yml b/.cirrus.yml index 50c17765d0..7470bc6a9e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,8 +3,6 @@ # - https://cirrus-ci.org/guide/writing-tasks/#environment-variables # - https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks # - https://cirrus-ci.org/guide/linux/ -# - https://cirrus-ci.org/guide/macOS/ -# - https://cirrus-ci.org/guide/windows/ # - https://hub.docker.com/_/gcc/ # - https://hub.docker.com/_/python/ @@ -12,7 +10,7 @@ # Global defaults. # container: - image: python:3.8 + image: gcc:latest cpu: 2 memory: 4G @@ -84,6 +82,7 @@ linux_task_template: &LINUX_TASK_TEMPLATE - echo "${CIRRUS_TASK_NAME}" - echo "${NOX_CACHE_BUILD}" + # # YAML alias for compute credits. # @@ -113,6 +112,10 @@ lint_task: only_if: ${SKIP_LINT_TASK} == "" << : *CREDITS_TEMPLATE auto_cancellation: true + container: + image: python:3.8 + cpu: 2 + memory: 4G name: "${CIRRUS_OS}: flake8 and black" pip_cache: folder: ~/.cache/pip @@ -141,10 +144,6 @@ test_minimal_task: env: PY_VER: 3.8 name: "${CIRRUS_OS}: py${PY_VER} tests (minimal)" - container: - image: gcc:latest - cpu: 2 - memory: 4G << : *LINUX_TASK_TEMPLATE tests_script: - export CONDA_OVERRIDE_LINUX="$(uname -r | cut -d'+' -f1)" @@ -187,14 +186,9 @@ test_full_task: gallery_task: only_if: ${SKIP_GALLERY_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == "" << : *CREDITS_TEMPLATE - matrix: - env: - PY_VER: 3.8 + env: + PY_VER: 3.8 name: "${CIRRUS_OS}: py${PY_VER} doc tests (gallery)" - container: - image: gcc:latest - cpu: 2 - memory: 4G << : *IRIS_TEST_DATA_TEMPLATE << : *LINUX_TASK_TEMPLATE tests_script: @@ -211,17 +205,11 @@ gallery_task: doctest_task: only_if: ${SKIP_DOCTEST_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == "" << : *CREDITS_TEMPLATE - matrix: - env: - PY_VER: 3.8 - name: "${CIRRUS_OS}: py${PY_VER} doc tests" - container: - image: gcc:latest - cpu: 2 - memory: 4G env: + PY_VER: 3.8 MPL_RC_DIR: ${HOME}/.config/matplotlib MPL_RC_FILE: ${HOME}/.config/matplotlib/matplotlibrc + name: "${CIRRUS_OS}: py${PY_VER} doc tests" << : *IRIS_TEST_DATA_TEMPLATE << : *LINUX_TASK_TEMPLATE tests_script: @@ -241,17 +229,11 @@ doctest_task: linkcheck_task: only_if: ${SKIP_LINKCHECK_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == "" << : *CREDITS_TEMPLATE - matrix: - env: - PY_VER: 3.8 - name: "${CIRRUS_OS}: py${PY_VER} doc link check" - container: - image: gcc:latest - cpu: 2 - memory: 4G env: + PY_VER: 3.8 MPL_RC_DIR: ${HOME}/.config/matplotlib MPL_RC_FILE: ${HOME}/.config/matplotlib/matplotlibrc + name: "${CIRRUS_OS}: py${PY_VER} doc link check" << : *LINUX_TASK_TEMPLATE tests_script: - export CONDA_OVERRIDE_LINUX="$(uname -r | cut -d'+' -f1)" diff --git a/noxfile.py b/noxfile.py index a29b74899a..bf6c95acf6 100755 --- a/noxfile.py +++ b/noxfile.py @@ -50,6 +50,7 @@ def venv_populated(session: nox.sessions.Session) -> bool: def venv_changed(session: nox.sessions.Session) -> bool: """Returns True if the installed session is different to that specified in the lockfile.""" + changed = False cache = session_cachefile(session) lockfile = session_lockfile(session) if cache.is_file(): @@ -57,9 +58,8 @@ def venv_changed(session: nox.sessions.Session) -> bool: expected = hashlib.sha256(fi.read()).hexdigest() with open(cache, "r") as fi: actual = fi.read() - return actual != expected - else: - return False + changed = actual != expected + return changed def cache_venv(session: nox.sessions.Session) -> None: @@ -140,7 +140,7 @@ def prepare_venv(session: nox.sessions.Session) -> None: session.virtualenv.reuse_existing = _re_orig cache_venv(session) - logger.debug(f"Environment {venv_dir} up to date") + logger.debug(f"Environment {venv_dir} is up to date") cache_cartopy(session) @@ -210,7 +210,6 @@ def tests(session: nox.sessions.Session): """ prepare_venv(session) session.install("--no-deps", "--editable", ".") - session.run( "python", "-m",