Skip to content

Commit

Permalink
Merge branch 'main' into votable_issues
Browse files Browse the repository at this point in the history
* main: (94 commits)
  added support for make html-noapi and html-quick for the docs build (SciTools#4333)
  Refactor some netcdf save code (SciTools#4301)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4329)
  Update to loading docs to cover absence of 'or' for constraints (SciTools#4321)
  update latest.rst.template (SciTools#4323)
  stable cartopy feature download (SciTools#4328)
  Skip TestConstrainedLoad if data missing (SciTools#4319)
  Add 'Good First Issue' label to reasons an issue doesn't go stale (SciTools#4317)
  Gallery: simplify quiver example (SciTools#4120)
  Improve styling in a minor way in docs (SciTools#4314)
  bump version (SciTools#4310)
  Made clear we only test on Linux. (SciTools#4309)
  Updated environment lockfiles (SciTools#4308)
  Include Discussions in Getting Involved. (SciTools#4307)
  Fixed text to show as link. (SciTools#4305)
  [pre-commit.ci] pre-commit autoupdate (SciTools#4299)
  Updated environment lockfiles (SciTools#4298)
  cartopy feature download (SciTools#4304)
  Mesh Loading (AVD-1813) (SciTools#4262)
  reset whatsnew latest (SciTools#4288)
  ...
  • Loading branch information
tkknight committed Sep 21, 2021
2 parents 84b1d83 + 63c1220 commit a0c947b
Show file tree
Hide file tree
Showing 218 changed files with 25,755 additions and 8,342 deletions.
86 changes: 26 additions & 60 deletions .cirrus.yml
Expand Up @@ -18,30 +18,27 @@ container:
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"
# Increment the build number to force new cartopy cache upload.
CARTOPY_CACHE_BUILD: "0"
CARTOPY_CACHE_BUILD: "3"
# Increment the build number to force new conda cache upload.
CONDA_CACHE_BUILD: "0"
# Increment the build number to force new nox cache upload.
NOX_CACHE_BUILD: "0"
# Increment the build number to force new pip cache upload.
PIP_CACHE_BUILD: "0"
# Pip packages to be upgraded/installed.
PIP_CACHE_PACKAGES: "nox pip setuptools wheel"
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.
IRIS_TEST_DATA_VERSION: "2.0.0"
IRIS_TEST_DATA_VERSION: "2.4"
# Base directory for the iris-test-data.
IRIS_TEST_DATA_DIR: ${HOME}/iris-test-data

Expand Down Expand Up @@ -75,6 +72,14 @@ linux_task_template: &LINUX_TASK_TEMPLATE
fingerprint_script:
- echo "${CIRRUS_OS}"
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${CARTOPY_CACHE_BUILD}"
populate_script:
- conda create --quiet --name cartopy-cache cartopy
- source ${HOME}/miniconda/etc/profile.d/conda.sh >/dev/null 2>&1
- conda activate cartopy-cache >/dev/null 2>&1
- cd $(mktemp -d)
- wget --quiet https://raw.githubusercontent.com/SciTools/cartopy/v0.20.0/tools/cartopy_feature_download.py
- python cartopy_feature_download.py physical --output ${HOME}/.local/share/cartopy --no-warn
- conda deactivate >/dev/null 2>&1
nox_cache:
folder: ${CIRRUS_WORKING_DIR}/.nox
reupload_on_changes: true
Expand Down Expand Up @@ -108,59 +113,39 @@ iris_test_data_template: &IRIS_TEST_DATA_TEMPLATE
#
# Linting
#
lint_task:
task:
only_if: ${SKIP_LINT_TASK} == ""
<< : *CREDITS_TEMPLATE
auto_cancellation: true
container:
image: python:3.8
cpu: 2
memory: 4G
name: "${CIRRUS_OS}: linting"
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 lint
- nox --session precommit


#
# Testing Minimal (Linux)
# Testing (Linux)
#
test_minimal_task:
only_if: ${SKIP_TEST_MINIMAL_TASK} == "" && ${SKIP_ALL_TEST_TASKS} == ""
task:
only_if: ${SKIP_TEST_TASK} == ""
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.7
env:
PY_VER: 3.8
name: "${CIRRUS_OS}: py${PY_VER} tests (minimal)"
<< : *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


#
# Testing Full (Linux)
#
test_full_task:
only_if: ${SKIP_TEST_FULL_TASK} == "" && ${SKIP_ALL_TEST_TASKS} == ""
<< : *CREDITS_TEMPLATE
matrix:
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 @@ -176,35 +161,16 @@ test_full_task:


#
# Testing Documentation Gallery (Linux)
#
gallery_task:
only_if: ${SKIP_GALLERY_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == ""
<< : *CREDITS_TEMPLATE
env:
PY_VER: 3.8
name: "${CIRRUS_OS}: py${PY_VER} doc tests (gallery)"
<< : *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:
task:
only_if: ${SKIP_DOCTEST_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == ""
<< : *CREDITS_TEMPLATE
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"
name: "${CIRRUS_OS}: py${PY_VER} doctests and gallery"
<< : *IRIS_TEST_DATA_TEMPLATE
<< : *LINUX_TASK_TEMPLATE
tests_script:
Expand All @@ -219,16 +185,16 @@ doctest_task:


#
# Testing Documentation Link Check (Linux)
# Documentation Link Check (Linux)
#
linkcheck_task:
task:
only_if: ${SKIP_LINKCHECK_TASK} == "" && ${SKIP_ALL_DOC_TASKS} == ""
<< : *CREDITS_TEMPLATE
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"
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: 48 additions & 0 deletions .github/workflows/benchmark.yml
@@ -0,0 +1,48 @@
# This is a basic workflow to help you get started with Actions

name: benchmark-check

on:
# Triggers the workflow on push or pull request events but only for the master branch
pull_request:

jobs:
benchmark:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Checkout the branches
run: |
git fetch --depth=1 origin ${{ github.event.pull_request.base.ref }}
git branch _base FETCH_HEAD
git fetch --depth=1 origin ${{ github.ref }}
git branch _head FETCH_HEAD
- name: Setup asv
run: |
pip install asv
cd benchmarks
asv machine --yes
- name: Run benchmarks on source and target
run: |
cd benchmarks
asv continuous --factor 1.2 _base _head
- name: Write a compare file to the output folder
if: ${{ always() }}
run: |
cd benchmarks
asv compare -s _base _head > .asv/compare.txt
- name: Archive asv results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: asv-report
path: |
benchmarks/.asv/results
benchmarks/.asv/compare.txt
78 changes: 78 additions & 0 deletions .github/workflows/stale.yml
@@ -0,0 +1,78 @@
# See https://github.com/actions/stale

name: Stale issues and pull-requests
on:
schedule:
- cron: 0 0 * * *

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

# Idle number of days before marking issues/prs stale.
days-before-stale: 500

# Idle number of days before closing stale issues/prs.
days-before-close: 28

# Comment on the staled issues.
stale-issue-message: |
In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity.
If this issue is still important to you, then please comment on this issue and the stale label will be removed.
Otherwise this issue will be automatically closed in 28 days time.
# Comment on the staled prs.
stale-pr-message: |
In order to maintain a backlog of relevant PRs, we automatically label them as stale after 500 days of inactivity.
If this PR is still important to you, then please comment on this PR and the stale label will be removed.
Otherwise this PR will be automatically closed in 28 days time.
# Comment on the staled issues while closed.
close-issue-message: |
This stale issue has been automatically closed due to a lack of community activity.
If you still care about this issue, then please either:
* Re-open this issue, if you have sufficient permissions, or
* Add a comment pinging `@SciTools/iris-devs` who will re-open on your behalf.
# Comment on the staled prs while closed.
close-pr-message: |
This stale PR has been automatically closed due to a lack of community activity.
If you still care about this PR, then please either:
* Re-open this PR, if you have sufficient permissions, or
* Add a comment pinging `@SciTools/iris-devs` who will re-open on your behalf.
# Label to apply on staled issues.
stale-issue-label: Stale

# Label to apply on staled prs.
stale-pr-label: Stale

# Labels on issues exempted from stale.
exempt-issue-labels: |
"Status: Blocked,Status: Decision Required,Peloton 🚴‍♂️,Good First Issue"
# Labels on prs exempted from stale.
exempt-pr-labels: |
"Status: Blocked,Status: Decision Required,Peloton 🚴‍♂️,Good First Issue"
# Max number of operations per run.
operations-per-run: 300

# Remove stale label from issues/prs on updates/comments.
remove-stale-when-updated: true

# Order to get issues/PRs.
ascending: true

# Exempt all issues/prs with milestones from stale.
exempt-all-milestones: true
1 change: 0 additions & 1 deletion .gitignore
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
36 changes: 25 additions & 11 deletions .pre-commit-config.yaml
@@ -1,8 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

files: |
(?x)(
noxfile\.py|
setup\.py|
docs\/.+\.py|
lib\/.+\.py
)
minimum_pre_commit_version: 1.21.0

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.0.1"
rev: v4.0.1
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
Expand All @@ -16,27 +26,31 @@ repos:
- id: debug-statements
# Don't commit to main branch.
- id: no-commit-to-branch

- repo: https://github.com/psf/black
rev: "21.6b0"
rev: 21.9b0
hooks:
- id: black
pass_filenames: false
args: ["--config=./pyproject.toml", "--check", "docs", "lib", "noxfile.py", "setup.py"]
args: [--config=./pyproject.toml, .]

- repo: https://github.com/PyCQA/flake8
rev: "3.9.2"
rev: 3.9.2
hooks:
- id: flake8
args: ["--config=./setup.cfg", "docs", "lib", "noxfile.py", "setup.py"]
types: [file, python]
args: [--config=./setup.cfg]

- repo: https://github.com/pycqa/isort
rev: "5.9.1"
rev: 5.9.3
hooks:
- id: isort
# Align CLI usage with other hooks, rather than use isort "src_paths" option
# in the pyproject.toml configuration.
name: isort
args: ["--filter-files", "--check", "docs", "lib", "noxfile.py", "setup.py"]
types: [file, python]
args: [--filter-files]

- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
rev: v1.11.0
hooks:
- id: blacken-docs
types: [file, rst]
additional_dependencies: [black==21.6b0]
3 changes: 1 addition & 2 deletions MANIFEST.in
Expand Up @@ -3,9 +3,8 @@ include CHANGES COPYING COPYING.LESSER

# Files from setup.py package_data that are not automatically added to source distributions
recursive-include lib/iris/tests/results *.cml *.cdl *.txt *.xml *.json
recursive-exclude lib/iris/fileformats/_pyke_rules/compiled_krb *
recursive-include lib/iris/etc *
include lib/iris/fileformats/_pyke_rules/*.krb
include lib/iris/tests/stock/file_headers/*

recursive-include requirements *

Expand Down

0 comments on commit a0c947b

Please sign in to comment.