Skip to content

Commit 61b3254

Browse files
authored
Merge pull request #862 from pangeo-data/pep621-compliance
Adopt PEP621 and src layout, support Python3.12, drop Python3.8
2 parents 831d109 + ab3b619 commit 61b3254

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+239
-247
lines changed

.github/workflows/benchmarks.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,36 @@ jobs:
1010
benchmark:
1111
if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
1212
name: Linux
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
env:
1515
ASV_DIR: "./asv_bench"
16-
16+
defaults:
17+
run:
18+
shell: bash -l {0}
19+
strategy:
20+
matrix:
21+
python-version: ["3.10"]
1722
steps:
1823
# We need the full repo to avoid this issue
1924
# https://github.com/actions/checkout/issues/23
2025
- uses: actions/checkout@v4
2126
with:
2227
fetch-depth: 0
2328

24-
- name: Setup Miniconda
25-
uses: conda-incubator/setup-miniconda@v3
29+
- name: Set up conda (micromamba)
30+
uses: mamba-org/setup-micromamba@v1
2631
with:
27-
# installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
28-
installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
32+
environment-name: climpred-benchmarks
33+
cache-environment: true
34+
create-args: >-
35+
python=${{ matrix.python-version }}
36+
conda
2937
30-
- name: Setup some dependencies
31-
shell: bash -l {0}
38+
- name: Set Up Dependencies
3239
run: |
33-
pip install asv
40+
python -m pip install asv
3441
sudo apt-get update -y
3542
- name: Run benchmarks
36-
shell: bash -l {0}
3743
id: benchmark
3844
env:
3945
OPENBLAS_NUM_THREADS: 1

.github/workflows/climpred_installs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,44 @@ jobs:
2525
keyword: "[skip-ci]"
2626

2727
install-climpred-complete: # Installs climpred on various OS.
28-
name: Install climpred[complete], ${{ matrix.os }}
28+
name: Install climpred[complete], ${{ matrix.os }}, Python${{ matrix.python-version }}
2929
runs-on: ${{ matrix.os }}
3030
needs: detect-ci-trigger
3131
if: needs.detect-ci-trigger.outputs.triggered == 'false'
3232
strategy:
3333
fail-fast: false
3434
matrix:
3535
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
36+
python-version: ["3.9"]
3637
steps:
3738
- uses: actions/checkout@v4
3839
- name: Setup Python
3940
uses: actions/setup-python@v5
4041
with:
41-
python-version: 3.9
42+
python-version: ${{ matrix.python-version }}
4243
- name: Install dependencies
4344
run: |
4445
pip install -e .[complete]
4546
python -c "import climpred"
4647
4748
install-climpred: # Installs climpred on various OS.
48-
name: Install climpred, ${{ matrix.os }}
49+
name: Install climpred, ${{ matrix.os }}, Python${{ matrix.python-version }}
4950
runs-on: ${{ matrix.os }}
5051
needs: detect-ci-trigger
5152
if: needs.detect-ci-trigger.outputs.triggered == 'false'
5253
strategy:
5354
fail-fast: false
5455
matrix:
5556
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
57+
python-version: ["3.9"]
5658
steps:
5759
- uses: actions/checkout@v4
5860
with:
5961
fetch-depth: 0 # Fetch all history for all branches and tags.
6062
- name: Setup Python
6163
uses: actions/setup-python@v5
6264
with:
63-
python-version: 3.9
65+
python-version: ${{ matrix.python-version }}
6466
- name: Install dependencies
6567
run: |
6668
pip install -e .

.github/workflows/climpred_testing.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ jobs:
2727
keyword: "[skip-ci]"
2828

2929
minimum-test: # Runs testing suite with minimal dependencies
30-
name: Test minimum dependencies, Python3.9
30+
name: Test minimum dependencies, Python${{ matrix.python-version }}
3131
runs-on: ubuntu-latest
3232
needs: detect-ci-trigger
3333
if: needs.detect-ci-trigger.outputs.triggered == 'false'
3434
defaults:
3535
run:
3636
shell: bash -l {0}
37+
strategy:
38+
matrix:
39+
python-version: ["3.9", "3.12"]
3740
steps:
3841
- uses: actions/checkout@v4
3942
with:
@@ -45,7 +48,7 @@ jobs:
4548
environment-name: climpred-minimum-tests
4649
cache-environment: true
4750
create-args: >-
48-
python=3.9
51+
python=${{ matrix.python-version }}
4952
conda
5053
- name: Install climpred
5154
run: |
@@ -75,16 +78,22 @@ jobs:
7578
strategy:
7679
fail-fast: false
7780
matrix:
78-
env: [""]
7981
include:
8082
- env: "climpred-maximum-tests"
8183
python-version: "3.9"
84+
extras: "esmpy=*=mpi*" # Ensures MPI works with version of esmpy.
8285
os: ubuntu-latest
8386
- env: "climpred-maximum-tests"
8487
python-version: "3.10"
88+
extras: "esmpy=*=mpi*" # Ensures MPI works with version of esmpy.
8589
os: ubuntu-latest
8690
- env: "climpred-maximum-tests-upstream"
8791
python-version: "3.11"
92+
extras: "esmpy=*=mpi*" # Ensures MPI works with version of esmpy.
93+
os: ubuntu-latest
94+
- env: "climpred-maximum-tests"
95+
python-version: "3.12"
96+
extras: "esmpy" # MPI is not supported in lastest esmpy conda packages for Python3.12
8897
os: ubuntu-latest
8998
steps:
9099
- uses: actions/checkout@v4
@@ -96,10 +105,11 @@ jobs:
96105
environment-file: ci/requirements/maximum-tests.yml
97106
environment-name: climpred-maximum-tests
98107
cache-environment: true
99-
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
108+
cache-environment-key: "${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ env.TODAY }}-${{ hashFiles(env.CONDA_ENV_FILE) }}"
100109
create-args: >-
101-
python=${{matrix.python-version}}
102110
conda
111+
python=${{ matrix.python-version }}
112+
${{ matrix.extras }}
103113
- name: Install climpred[complete]
104114
run: |
105115
python -m pip install -e .[complete]
@@ -128,11 +138,14 @@ jobs:
128138
fail_ci_if_error: false
129139

130140
doctest: # tests all docstrings
131-
name: Doctests, Python3.9
132-
runs-on: "ubuntu-latest"
141+
name: Doctests, Python${{ matrix.python-version }}
142+
runs-on: ubuntu-latest
133143
defaults:
134144
run:
135145
shell: bash -l {0}
146+
strategy:
147+
matrix:
148+
python-version: ["3.9"]
136149
steps:
137150
- uses: actions/checkout@v4
138151
- name: Setup conda (micromamba)
@@ -142,7 +155,7 @@ jobs:
142155
environment-name: climpred-maximum-tests
143156
cache-environment: true
144157
create-args: >-
145-
python=3.9
158+
python=${{ matrix.python-version }}
146159
conda
147160
- name: Install climpred[complete]
148161
run: |
@@ -156,14 +169,17 @@ jobs:
156169
conda list
157170
- name: Run doctests
158171
run: |
159-
python -m pytest --doctest-modules climpred --ignore climpred/tests
172+
python -m pytest --doctest-modules src/climpred --ignore src/climpred/tests
160173
161174
notebooks: # Checks that pre-compiled notebooks in docs still work.
162-
name: Notebooks, Python3.9
175+
name: Notebooks, Python${{ matrix.python-version }}
163176
runs-on: ubuntu-latest
164177
defaults:
165178
run:
166179
shell: bash -l {0}
180+
strategy:
181+
matrix:
182+
python-version: ["3.9"]
167183
steps:
168184
- uses: actions/checkout@v4
169185
- name: Set up conda (micromamba)
@@ -173,7 +189,7 @@ jobs:
173189
environment-name: climpred-docs
174190
cache-environment: true
175191
create-args: >-
176-
python=3.9
192+
python=${{ matrix.python-version }}
177193
conda
178194
- name: Install climpred
179195
run: |

.github/workflows/publish-production-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python3
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: '3.x'
20+
python-version: "3.x"
2121
- name: Install packaging libraries
2222
run: |
2323
python -m pip install --upgrade pip

.github/workflows/publish-staging-testpypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Python3
3535
uses: actions/setup-python@v5
3636
with:
37-
python-version: '3.x'
37+
python-version: "3.x"
3838
- name: Install packaging libraries
3939
run: |
4040
python -m pip install --upgrade pip

.github/workflows/upstream-dev-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
keyword: "[test-upstream]"
2929

3030
upstream-dev:
31-
name: upstream-dev
31+
name: upstream-dev, Python${{ matrix.python-version }}
3232
runs-on: ubuntu-latest
3333
needs: detect-ci-trigger
3434
if: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ asv_bench/.asv/
114114
# VS Code
115115
.vscode/
116116

117+
# PyCharm
118+
.idea/
119+
120+
# dask
117121
dask-worker-space
118122

119123
# End of https://www.gitignore.io/api/python

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ repos:
2121
exclude: '.ipynb|asv.conf.json'
2222
- id: trailing-whitespace
2323

24+
- repo: https://github.com/pappasam/toml-sort
25+
rev: v0.23.1
26+
hooks:
27+
- id: toml-sort-fix
28+
2429
- repo: https://github.com/psf/black-pre-commit-mirror
2530
rev: 24.4.2
2631
hooks:
@@ -30,6 +35,7 @@ repos:
3035
rev: 7.1.0
3136
hooks:
3237
- id: flake8
38+
args: [ '--max-line-length=93', '--extend-ignore=W503' ]
3339

3440
- repo: https://github.com/PyCQA/isort
3541
rev: 5.13.2

CHANGELOG.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Internals/Minor Fixes
2222
- Fixed some issues with the documentation build to address rendering errors and reduce the number of warnings on ReadTheDocs. (pr:`843`) `Trevor James Smith`_
2323
- Fixed some issues with the typing hints of classes functions. (pr:`850`) `Trevor James Smith`_
2424
- Fixed several issues with incompatible dependency configurations in the CI and addressed a few deprecations. (pr:`861`) `Trevor James Smith`_
25+
- `climpred` has adopted `PEP 621 <https://peps.python.org/pep-0621/>`_ for specifying project metadata. (pr:`862`) `Trevor James Smith`_
26+
- `climpred` now uses the `src layout <https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/>`_ for the package file structure. (pr:`862`) `Trevor James Smith`_
27+
- Drop ``python<=3.8`` support. (:pr:`862`) `Trevor James Smith`_.
2528

2629
climpred v2.4.0 (2023-11-09)
2730
============================
@@ -224,7 +227,6 @@ Data variables:
224227
using :py:func:`~climpred.reference.compute_persistence_from_first_lead`.
225228
(:issue:`637`, :pr:`706`) `Aaron Spring`_.
226229

227-
228230
Internals/Minor Fixes
229231
---------------------
230232
- Reduce dependencies. (:pr:`686`) `Aaron Spring`_.
@@ -1038,6 +1040,7 @@ Documentation
10381040
- Add page for `publications <publications.html>`_ and
10391041
`helpful links <helpful-links.html>`_. (:pr:`270`) `Riley X. Brady`_.
10401042

1043+
10411044
climpred v1.1.0 (2019-09-23)
10421045
============================
10431046

@@ -1072,6 +1075,7 @@ Documentation
10721075
- Add scope of package to docs for clarity for users and developers. (:pr:`235`)
10731076
`Riley X. Brady`_.
10741077

1078+
10751079
climpred v1.0.1 (2019-07-04)
10761080
============================
10771081

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. image:: https://i.imgur.com/HPOdOsR.png
22

3-
Verification of weather and climate forecasts.
3+
Verification of weather and climate forecasts
44

55
..
66
Table version of badges inspired by pySTEPS.
@@ -128,7 +128,7 @@ You can install the latest release of ``climpred`` using ``pip`` or ``conda``:
128128

129129
.. code-block:: bash
130130
131-
pip install climpred[complete]
131+
python -m pip install climpred[complete]
132132
133133
.. code-block:: bash
134134
@@ -141,7 +141,7 @@ repository or installing directly from GitHub:
141141
142142
git clone https://github.com/pangeo-data/climpred.git
143143
cd climpred
144-
pip install . --upgrade
144+
python -m pip install . --upgrade
145145
146146
.. code-block:: bash
147147

0 commit comments

Comments
 (0)