Skip to content

Commit

Permalink
Merge branch 'main' into theme_play
Browse files Browse the repository at this point in the history
* main: (43 commits)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4244)
  Updated environment lockfiles (SciTools#4242)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4239)
  Documented the --force option on conda env create (SciTools#4240)
  Updated environment lockfiles (SciTools#4237)
  pre-commit isort and black --check only for cirrus-ci (SciTools#4235)
  Only run docs-building sessions with Python 3.8. (SciTools#4210)
  consolidate cirrus-ci documentation tasks (SciTools#4219)
  Updated environment lockfiles (SciTools#4223)
  Replace pyke nopyke (SciTools#4198)
  drop cirrus-ci minimal tests (SciTools#4218)
  remove change management tech paper (SciTools#4217)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4213)
  Updated environment lockfiles (SciTools#4212)
  Widen cube printout for long ancil or cell-measure names. (SciTools#4124)
  convert docs print statements (SciTools#4209)
  optimise pre-commit (SciTools#4208)
  drop black and flake8 dependencies (SciTools#4181)
  pre-commit blacked docs (SciTools#4205)
  pre-commit update (SciTools#4204)
  ...
  • Loading branch information
tkknight committed Jul 21, 2021
2 parents b7b8539 + a6cd220 commit 2155913
Show file tree
Hide file tree
Showing 478 changed files with 6,692 additions and 5,328 deletions.
111 changes: 23 additions & 88 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,25 @@
# - 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/

#
# Global defaults.
#
container:
image: python:3.8
image: gcc:latest
cpu: 2
memory: 4G


env:
# Skip specific tasks by name. Set to a non-empty string to skip.
SKIP_LINT_TASK: ""
SKIP_TEST_MINIMAL_TASK: ""
SKIP_TEST_FULL_TASK: ""
SKIP_GALLERY_TASK: ""
SKIP_TEST_TASK: ""
SKIP_DOCTEST_TASK: ""
SKIP_LINKCHECK_TASK: ""
# Skip task groups by type. Set to a non-empty string to skip.
SKIP_ALL_TEST_TASKS: ""
SKIP_ALL_DOC_TASKS: ""
# Maximum cache period (in weeks) before forcing a new cache upload.
CACHE_PERIOD: "2"
Expand All @@ -39,7 +34,7 @@ env:
# Increment the build number to force new pip cache upload.
PIP_CACHE_BUILD: "0"
# Pip packages to be upgraded/installed.
PIP_CACHE_PACKAGES: "pip setuptools wheel nox"
PIP_CACHE_PACKAGES: "nox pip pyyaml setuptools wheel"
# Conda packages to be installed.
CONDA_CACHE_PACKAGES: "nox pip"
# Git commit hash for iris test data.
Expand Down Expand Up @@ -84,11 +79,12 @@ linux_task_template: &LINUX_TASK_TEMPLATE
- echo "${CIRRUS_TASK_NAME}"
- echo "${NOX_CACHE_BUILD}"


#
# YAML alias for compute credits.
#
compute_credits_template: &CREDITS_TEMPLATE
# Only use credits for non-DRAFT pull-requests to SciTools/iris master branch by collaborators
# Restrict where compute credits are used.
use_compute_credits: ${CIRRUS_REPO_FULL_NAME} == "SciTools/iris" && ${CIRRUS_USER_COLLABORATOR} == "true" && ${CIRRUS_PR_DRAFT} == "false" && ${CIRRUS_PR} != ""


Expand All @@ -109,64 +105,39 @@ iris_test_data_template: &IRIS_TEST_DATA_TEMPLATE
#
# Linting
#
lint_task:
precommit_task:
only_if: ${SKIP_LINT_TASK} == ""
<< : *CREDITS_TEMPLATE
auto_cancellation: true
name: "${CIRRUS_OS}: flake8 and black"
container:
image: python:3.8
cpu: 2
memory: 4G
name: "${CIRRUS_OS}: pre-commit hooks"
pip_cache:
folder: ~/.cache/pip
fingerprint_script:
- echo "${CIRRUS_TASK_NAME} py${PYTHON_VERSION}"
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${PIP_CACHE_BUILD} ${PIP_CACHE_PACKAGES}"
lint_script:
precommit_script:
- pip list
- python -m pip install --retries 3 --upgrade ${PIP_CACHE_PACKAGES}
- pip list
- nox --session flake8
- nox --session black


#
# Testing Minimal (Linux)
#
test_minimal_task:
only_if: ${SKIP_TEST_MINIMAL_TASK} == "" && ${SKIP_ALL_TEST_TASKS} == ""
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
env:
PY_VER: 3.7
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)"
- echo "[Resources]" > ${SITE_CFG}
- echo "doc_dir = ${CIRRUS_WORKING_DIR}/docs" >> ${SITE_CFG}
- nox --session tests -- --verbose
- nox --session precommit


#
# Testing Full (Linux)
# Testing (Linux)
#
test_full_task:
only_if: ${SKIP_TEST_FULL_TASK} == "" && ${SKIP_ALL_TEST_TASKS} == ""
test_task:
only_if: ${SKIP_TEST_TASK} == ""
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
env:
PY_VER: 3.7
env:
PY_VER: 3.8
name: "${CIRRUS_OS}: py${PY_VER} tests (full)"
name: "${CIRRUS_OS}: py${PY_VER} tests"
container:
image: gcc:latest
cpu: 6
Expand All @@ -182,46 +153,16 @@ test_full_task:


#
# Testing Documentation Gallery (Linux)
#
gallery_task:
only_if: ${SKIP_GALLERY_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == ""
<< : *CREDITS_TEMPLATE
matrix:
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:
- export CONDA_OVERRIDE_LINUX="$(uname -r | cut -d'+' -f1)"
- echo "[Resources]" > ${SITE_CFG}
- echo "test_data_dir = ${IRIS_TEST_DATA_DIR}/test_data" >> ${SITE_CFG}
- echo "doc_dir = ${CIRRUS_WORKING_DIR}/docs" >> ${SITE_CFG}
- nox --session gallery -- --verbose


#
# Testing Documentation (Linux)
# Documentation Testing and Gallery (Linux)
#
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} doctests and gallery"
<< : *IRIS_TEST_DATA_TEMPLATE
<< : *LINUX_TASK_TEMPLATE
tests_script:
Expand All @@ -236,22 +177,16 @@ doctest_task:


#
# Testing Documentation Link Check (Linux)
# Documentation Link Check (Linux)
#
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} link check"
<< : *LINUX_TASK_TEMPLATE
tests_script:
- export CONDA_OVERRIDE_LINUX="$(uname -r | cut -d'+' -f1)"
Expand Down
48 changes: 0 additions & 48 deletions .flake8

This file was deleted.

14 changes: 13 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
See the [Developers Guide](https://scitools-iris.readthedocs.io/en/latest/index.html#development-index)
# Contributing to Iris

Want to contribute to Iris? But don't know where to start 🤔

We recommend that you first checkout our advice to [First Time Contributors](https://github.com/SciTools/iris/issues/4133),
which has some solid suggestions on where to begin.

Otherwise, head over to our [Developers Guide on Getting Involved](https://scitools-iris.readthedocs.io/en/stable/developers_guide/contributing_getting_involved.html)
for all the information you need to start on your Iris development journey.

Still need help or advice?

Then join us over on our [Iris GitHub Discussions](https://github.com/SciTools/iris/discussions). We'd love to hear from you!
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ Steps to reproduce the behaviour:
<summary>Click to expand <b>this section...</b></summary>

```
Add additional verbose information in a collapsible section.
Please add additional verbose information in this section e.g., code, output, tracebacks, screenshots etc
```
See [here](https://gist.github.com/pierrejoubert73/902cc94d79424356a8d20be2b382e1ab) for further details.
</details>

4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# reference: https://docs.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false
contact_links:
- name: 💬 Iris GitHub Discussions
url: https://github.com/SciTools/iris/discussions
about: Engage with the Iris community to discuss your issue
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ assignees: ''
<summary>Click to expand <b>this section...</b></summary>

```
Add additional verbose information in a collapsible section.
Please add additional verbose information in this section e.g., references, screenshots, listings etc
```
See [here](https://gist.github.com/pierrejoubert73/902cc94d79424356a8d20be2b382e1ab) for further details.
</details>

46 changes: 43 additions & 3 deletions .github/workflows/refresh-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,69 @@
# pinned at specific versions.
#
# For environments that have changed, a pull request will be made and submitted
# to the master branch
# to the main branch

name: Refresh Lockfiles


on:
workflow_dispatch:
inputs:
clobber:
description: |
Force the workflow to run, potentially clobbering any commits already made to the branch.
Enter "yes" or "true" to run.
default: "no"
schedule:
# Run once a week on a Saturday night
- cron: 1 0 * * 6


jobs:

no_clobber:
runs-on: ubuntu-latest
steps:
# check if the auto-update-lockfiles branch exists. If it does, and someone other than
# the lockfile bot has made the head commit, abort the workflow.
# This job can be manually overridden by running directly from the github actions panel
# (known as a "workflow_dispatch") and setting the `clobber` input to "yes".
- uses: actions/script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
if (context.eventName == "workflow_dispatch") {
const clobber = context.payload.inputs.clobber || "no";
if (["yes", "true", "y"].includes(clobber.trim().toLowerCase())) {
core.info("Manual override, continuing workflow, potentially overwriting previous commits to auto-update-lockfiles");
return
}
}
github.repos.getBranch({...context.repo, branch: "auto-update-lockfiles"}).then(res => {
const committer = res.data.commit.commit.committer;
if (committer && committer.name === "Lockfile bot") {
core.info("Lockfile bot was the last to push to auto-update-lockfiles. Continue.");
} else {
core.setFailed("New commits to auto-update-lockfiles since bot last ran. Abort!");
}
}).catch(err => {
if (err.status === 404) {
core.info("auto-update-lockfiles branch not found, continue");
}
})
gen_lockfiles:
# this is a matrix job: it splits to create new lockfiles for each
# of the CI test python versions.
# this list below should be changed when covering more python versions
# TODO: generate this matrix automatically from the list of available py**.yml files
# ref: https://tomasvotruba.com/blog/2020/11/16/how-to-make-dynamic-matrix-in-github-actions/
runs-on: ubuntu-latest
needs: no_clobber

strategy:
matrix:
python: ['36', '37', '38']
python: ['37', '38']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -62,14 +100,16 @@ jobs:
path: artifacts

- name: Update lock files in repo
run: |
run: |
cp artifacts/artifact/*.lock requirements/ci/nox.lock
rm -r artifacts
- name: Create Pull Request
uses: peter-evans/create-pull-request@052fc72b4198ba9fbc81b818c6e1859f747d49a8
with:
commit-message: Updated environment lockfiles
committer: "Lockfile bot <noreply@github.com>"
author: "Lockfile bot <noreply@github.com>"
delete-branch: true
branch: auto-update-lockfiles
title: Update CI environment lockfiles
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pip-cache
# Created by Iris build
*.so
lib/iris/etc/site.cfg
lib/iris/fileformats/_pyke_rules/compiled_krb/
lib/iris/std_names.py

# Iris test result files
Expand Down
Loading

0 comments on commit 2155913

Please sign in to comment.