Skip to content

Commit

Permalink
Merge branch 'main' into FEATURE_split_attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo authored Jul 17, 2023
2 parents f485f8a + 5b42f47 commit 2549f05
Show file tree
Hide file tree
Showing 846 changed files with 47,906 additions and 29,525 deletions.
49 changes: 49 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[flake8]
# References:
# https://flake8.readthedocs.io/en/latest/user/configuration.html
# https://flake8.readthedocs.io/en/latest/user/error-codes.html
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes

max-line-length = 80
max-complexity = 50
select = C,E,F,W,B,B950
ignore =
# E203: whitespace before ':'
E203,
# E226: missing whitespace around arithmetic operator
E226,
# E231: missing whitespace after ',', ';', or ':'
E231,
# E402: module level imports on one line
E402,
# E501: line too long
E501,
# E731: do not assign a lambda expression, use a def
E731,
# W503: line break before binary operator
W503,
# W504: line break after binary operator
W504,
exclude =
#
# ignore the following directories
#
.eggs,
build,
docs/src/sphinxext/*,
tools/*,
benchmarks/*,
#
# ignore auto-generated files
#
_ff_cross_refrences.py,
std_names.py,
um_cf_map.py,
#
# ignore third-party files
#
gitwash_dumper.py,
#
# convenience imports
#
lib/iris/common/__init__.py
20 changes: 20 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Format: numpy array format (#5235)
c18dcd8dafef0cc7bbbf80dfce66f76a46ce59c5

# style: flake8 (#3755)
7c86bc0168684345dc475457b1a77dadc77ce9bb

# style: black (#3518)
ffcfad475e0593e1e40895453cf1df154e5f6f2c

# style: isort (#4174)
15bbcc5ac3d539cb6e820148b66e7cf55d91c5d2

# style: blacken-docs (#4205)
1572e180243e492d8ff76fa8cdefb82ef6f90415

# style: sort-all (#4353)
64705dbc40881233aae45f051d96049150369e53

# style: codespell (#5186)
417aa6bbd9b10d25cad7def54d47ef4d718bc38d
24 changes: 18 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,34 @@ on:
description: "Argument to be passed to the overnight benchmark script."
required: false
type: string
pull_request:
types: [labeled]

jobs:
benchmark:
if: "github.repository == 'SciTools/iris'"
if: >
github.repository == 'SciTools/iris' &&
(github.event_name != 'pull_request' ||
github.event.label.name == 'benchmark_this')
runs-on: ubuntu-latest

env:
IRIS_TEST_DATA_LOC_PATH: benchmarks
IRIS_TEST_DATA_PATH: benchmarks/iris-test-data
IRIS_TEST_DATA_VERSION: "2.18"
IRIS_TEST_DATA_VERSION: "2.19"
# Lets us manually bump the cache to rebuild
ENV_CACHE_BUILD: "0"
TEST_DATA_CACHE_BUILD: "2"
PY_VER: 3.8

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Nox
- name: Install ASV & Nox
run: |
pip install nox
pip install asv nox
- name: Cache environment directories
id: cache-env-dir
Expand Down Expand Up @@ -68,7 +72,14 @@ jobs:
run: |
echo "OVERRIDE_TEST_DATA_REPOSITORY=${GITHUB_WORKSPACE}/${IRIS_TEST_DATA_PATH}/test_data" >> $GITHUB_ENV
- name: Benchmark this pull request
if: ${{ github.event.label.name == 'benchmark_this' }}
run: |
git checkout ${{ github.head_ref }}
python benchmarks/bm_runner.py branch origin/${{ github.base_ref }}
- name: Run overnight benchmarks
if: ${{ github.event_name != 'pull_request' }}
run: |
first_commit=${{ inputs.first_commit }}
if [ "$first_commit" == "" ]
Expand All @@ -78,10 +89,11 @@ jobs:
if [ "$first_commit" != "" ]
then
nox --session="benchmarks(overnight)" -- $first_commit
python benchmarks/bm_runner.py overnight $first_commit
fi
- name: Create issues for performance shifts
if: ${{ github.event_name != 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Reference
# - https://github.com/actions/checkout

name: ci-manifest

on:
pull_request:
branches:
- "*"

push:
branches-ignore:
- "auto-update-lockfiles"
- "pre-commit-ci-update-config"
- "dependabot/*"

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
manifest:
name: "check-manifest"
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2023.06.0
24 changes: 16 additions & 8 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
session: ["tests", "doctest", "gallery", "linkcheck"]
python-version: ["3.11"]
session: ["doctest", "gallery", "linkcheck"]
include:
- os: "ubuntu-latest"
python-version: "3.9"
python-version: "3.11"
session: "tests"
coverage: "--coverage"
- os: "ubuntu-latest"
python-version: "3.10"
session: "tests"
- os: "ubuntu-latest"
python-version: "3.8"
python-version: "3.9"
session: "tests"

env:
IRIS_TEST_DATA_VERSION: "2.18"
IRIS_TEST_DATA_VERSION: "2.19"
ENV_NAME: "ci-tests"

steps:
Expand All @@ -59,7 +63,7 @@ jobs:
CACHE_WEEKS: 2
run: |
echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/locks/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
- name: "data cache"
uses: ./.github/workflows/composite/iris-data-cache
Expand Down Expand Up @@ -107,7 +111,7 @@ jobs:
- name: "nox cache"
uses: ./.github/workflows/composite/nox-cache
with:
cache_build: 0
cache_build: 2
env_name: ${{ env.ENV_NAME }}
lock_file: ${{ env.LOCK_FILE }}

Expand All @@ -133,4 +137,8 @@ jobs:
env:
PY_VER: ${{ matrix.python-version }}
run: |
nox --session ${{ matrix.session }} -- --verbose
nox --session ${{ matrix.session }} -- --verbose ${{ matrix.coverage }}
- name: Upload coverage report
uses: codecov/codecov-action@v3
if: ${{ matrix.coverage }}
15 changes: 7 additions & 8 deletions .github/workflows/ci-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ jobs:
- name: "building"
shell: bash
run: |
# require build with explicit --sdist and --wheel in order to
# get correct version associated with sdist and bdist artifacts
pipx run build --sdist --wheel
pipx run build
- uses: actions/upload-artifact@v3
with:
Expand All @@ -54,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
session: ["wheel"]
env:
ENV_NAME: "ci-wheels"
Expand All @@ -74,7 +72,7 @@ jobs:
CACHE_WEEKS: 2
run: |
echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/locks/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
- name: "conda package cache"
uses: ./.github/workflows/composite/conda-pkg-cache
Expand Down Expand Up @@ -103,7 +101,7 @@ jobs:
- name: "nox cache"
uses: ./.github/workflows/composite/nox-cache
with:
cache_build: 0
cache_build: 1
env_name: ${{ env.ENV_NAME }}
lock_file: ${{ env.LOCK_FILE }}

Expand Down Expand Up @@ -132,7 +130,8 @@ jobs:
name: "publish to test.pypi"
runs-on: ubuntu-latest
# upload to Test PyPI for every commit on main branch
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
# and check for the SciTools repo
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'SciTools'
steps:
- uses: actions/download-artifact@v3
with:
Expand All @@ -152,7 +151,7 @@ jobs:
name: "publish to pypi"
runs-on: ubuntu-latest
# upload to PyPI for every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && github.repository_owner == 'SciTools'
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ on:

jobs:
refresh_lockfiles:
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@main
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2023.06.0
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: "github.repository == 'SciTools/iris'"
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ docs/iris_image_test_output/

# Files generated during test runs.
lib/iris/tests/results/**/*.dot
lib/iris/tests/results/PP/extra_char_data.w_data_loaded.pp.txt
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ repos:
# Don't commit to main branch.
- id: no-commit-to-branch

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.5"
hooks:
- id: codespell
types_or: [asciidoc, python, markdown, rst]
additional_dependencies: [tomli]

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
pass_filenames: false
Expand All @@ -40,7 +47,6 @@ repos:
hooks:
- id: flake8
types: [file, python]
args: [--config=./setup.cfg]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
Expand All @@ -50,7 +56,7 @@ repos:
args: [--filter-files]

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.15.0
hooks:
- id: blacken-docs
types: [file, rst]
Expand Down
4 changes: 1 addition & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build:
- git stash pop

conda:
environment: requirements/ci/readthedocs.yml
environment: requirements/readthedocs.yml

sphinx:
configuration: docs/src/conf.py
Expand All @@ -29,5 +29,3 @@ python:
install:
- method: pip
path: .
extra_requirements:
- docs
Loading

0 comments on commit 2549f05

Please sign in to comment.