Skip to content

Commit 27a204f

Browse files
authored
Merge branch 'main' into to_numpy/pandas_numeric
2 parents d3f3e5d + 8b6f61d commit 27a204f

31 files changed

+403
-464
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ jobs:
9191
with:
9292
# 'bash -el -c' is needed to use the custom shell.
9393
# See https://github.com/CodSpeedHQ/action/issues/65.
94-
run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P --pyargs pygmt --codspeed"
94+
run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P --pyargs pygmt --codspeed --override-ini addopts='--verbose'"

.github/workflows/check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Link Checker
3737
id: lychee
38-
uses: lycheeverse/lychee-action@v2.0.2
38+
uses: lycheeverse/lychee-action@v2.1.0
3939
with:
4040
fail: false # Don't fail action on broken links
4141
output: /tmp/lychee-out.md

.github/workflows/ci_tests.yaml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
# Test PyGMT on Linux/macOS/Windows
22
#
3-
# This workflow runs regular PyGMT tests and uploads test coverage reports stored
4-
# in `.coverage.xml` to https://app.codecov.io/gh/GenericMappingTools/pygmt
5-
# via the [Codecov GitHub Action](https://github.com/codecov/codecov-action).
6-
# More codecov related configurations are stored in `.github/codecov.yml`.
7-
# If any tests fail, it also uploads the diff images as workflow artifacts.
3+
# This workflow runs regular PyGMT tests and uploads test coverage reports stored in
4+
# `.coverage.xml` to https://app.codecov.io/gh/GenericMappingTools/pygmt via the
5+
# [Codecov GitHub Action](https://github.com/codecov/codecov-action). More codecov
6+
# related configurations are stored in `.github/codecov.yml`. If any tests fail, it also
7+
# uploads the diff images as workflow artifacts.
88
#
99
# It is run:
1010
# 1. on every commit to the main branch
11-
# 2. on every commit to the pull request branches, unless the pull requests only
12-
# contain non-code changes.
11+
# 2. on every commit to the pull request branches, unless the pull requests only contain
12+
# non-code changes.
1313
# 3. when a new release is published
1414
#
1515
# It is also scheduled to run daily on the main branch.
1616
#
17-
# In draft pull request, only two jobs on Linux are triggered to save on
18-
# Continuous Integration resources:
17+
# In draft pull request, only jobs on Linux are triggered to save on Continuous
18+
# Integration resources:
1919
#
20-
# - Minimum supported Python, NumPy, pandas, Xarray versions following [SPEC 0](https://scientific-python.org/specs/spec-0000/)
21-
# - Latest Python, NumPy versions + optional packages (e.g. GeoPandas)
20+
# - Minimum supported Python + core packages (minimum supported versions)
21+
# + optional packages (minimum supported versions if any)
22+
# - Latest Python + core packages (latest versions) + optional packages
23+
# - Last release before the latest Python + core packages
2224
#
2325
name: Tests
2426

@@ -59,35 +61,32 @@ jobs:
5961
# Is it a draft Pull Request (true or false)?
6062
isDraft:
6163
- ${{ github.event.pull_request.draft }}
62-
# Only run two jobs (Ubuntu + Python 3.10/3.12) for draft PRs
64+
# Only run three jobs on Ubuntu for draft PRs
6365
exclude:
6466
- os: macos-latest
6567
isDraft: true
6668
- os: windows-latest
6769
isDraft: true
68-
# Pair Python 3.10 with the minimum supported versions of NumPy, pandas, Xarray
69-
# and Python 3.12 with the latest versions of NumPy, pandas, Xarray
70-
# Only install optional packages on Python 3.12
7170
include:
71+
# Python 3.10 + core packages (minimum supported versions) + optional packages (minimum supported versions if any)
7272
- python-version: '3.10'
7373
numpy-version: '1.24'
7474
pandas-version: '=2.0'
7575
xarray-version: '=2023.04'
76-
optional-packages: ''
76+
optional-packages: ' contextily geopandas<1 ipython pyarrow rioxarray sphinx-gallery'
77+
# Python 3.12 + core packages (latest versions) + optional packages
7778
- python-version: '3.12'
7879
numpy-version: '2.1'
7980
pandas-version: ''
8081
xarray-version: ''
81-
optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery'
82-
# The job below is for testing GeoPandas v0.x on Ubuntu.
83-
# The python-version here can't be the versions in the matrix.python-version
84-
# defined above. Otherwise, other jobs will be overridden by this one.
82+
optional-packages: ' contextily geopandas>=1.0 ipython pyarrow rioxarray sphinx-gallery'
83+
# Python 3.11 + core packages (Linux only)
8584
- os: 'ubuntu-latest'
86-
python-version: '3.11' # Can't be 3.10 or 3.12.
87-
numpy-version: '1.24'
88-
pandas-version: '=2.1'
85+
python-version: '3.11'
86+
numpy-version: ''
87+
pandas-version: ''
8988
xarray-version: ''
90-
optional-packages: ' geopandas<1 pyarrow'
89+
optional-packages: ''
9190

9291
timeout-minutes: 30
9392
defaults:
@@ -143,7 +142,6 @@ jobs:
143142
pytest-doctestplus
144143
pytest-mpl
145144
pytest-rerunfailures
146-
pytest-xdist
147145
148146
# Download cached remote files (artifacts) from GitHub
149147
- name: Download remote data from GitHub
@@ -166,7 +164,7 @@ jobs:
166164

167165
# Run the regular tests
168166
- name: Run tests
169-
run: make test PYTEST_EXTRA="-r P -n auto --reruns 2"
167+
run: make test PYTEST_EXTRA="-r P --reruns 2"
170168

171169
# Upload diff images on test failure
172170
- name: Upload diff images if any test fails
@@ -178,10 +176,10 @@ jobs:
178176

179177
# Upload coverage to Codecov
180178
- name: Upload coverage to Codecov
181-
uses: codecov/codecov-action@v4.6.0
179+
uses: codecov/codecov-action@v5.0.3
182180
if: success() || failure()
183181
with:
184182
use_oidc: true
185-
file: ./coverage.xml # optional
183+
files: ./coverage.xml # optional
186184
env_vars: OS,PYTHON,NUMPY
187185
fail_ci_if_error: false

.github/workflows/ci_tests_dev.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
--extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
154154
numpy pandas xarray netCDF4 packaging \
155155
build contextily dvc geopandas ipython pyarrow rioxarray \
156-
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures pytest-xdist\
156+
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures \
157157
sphinx-gallery
158158
159159
# Show installed pkg information for postmortem diagnostic
@@ -181,7 +181,7 @@ jobs:
181181

182182
# Run the tests
183183
- name: Test with pytest
184-
run: make test PYTEST_EXTRA="-r P -n auto --reruns 2"
184+
run: make test PYTEST_EXTRA="-r P --reruns 2"
185185
env:
186186
GMT_LIBRARY_PATH: ${{ runner.temp }}/gmt-install-dir/lib
187187

.github/workflows/ci_tests_legacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
python=3.10
6363
gmt=${{ matrix.gmt_version }}
6464
ghostscript<10
65-
numpy
65+
numpy<2
6666
pandas
6767
xarray
6868
netCDF4

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ doctest: _runtest
5555
# run tests without image comparisons
5656
# run pytest without the --mpl option to disable image comparisons
5757
# use '-o addopts' to override 'addopts' settings in pyproject.toml file
58-
test_no_images: PYTEST_ARGS=-o addopts="--verbose --durations=0 --durations-min=0.2 --doctest-modules"
58+
test_no_images: PYTEST_ARGS=-o addopts="--verbose --color=yes --durations=0 --durations-min=0.2 --doctest-modules"
5959
test_no_images: _runtest
6060

6161
format:

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,7 @@ Other official wrappers for GMT:
191191
## Minimum supported versions
192192

193193
PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the
194-
rest of the scientific Python ecosystem, and therefore:
195-
196-
- Support for Python versions be dropped 3 years after their initial release.
197-
- Support for core package dependencies (NumPy, pandas, Xarray) be dropped 2 years after
198-
their initial release.
199-
200-
Similarly, the PyGMT team has decided to discontinue support for GMT versions 3 years
201-
after their initial release.
202-
203-
Please see [Minimum Supported Versions](https://www.pygmt.org/dev/minversions.html) for
204-
the minimum supported versions of GMT, Python and core package dependencies.
194+
rest of the scientific Python ecosystem, and made a few extensions based on the needs of
195+
the project. Please see [Minimum Supported Versions](https://www.pygmt.org/dev/minversions.html)
196+
for the detailed policy and the minimum supported versions of GMT, Python and core
197+
package dependencies.

doc/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,5 @@ server:
5555
clean:
5656
rm -rf $(BUILDDIR)
5757
rm -rf api/generated
58-
rm -rf intro
59-
rm -rf tutorials
60-
rm -rf gallery
61-
rm -rf projections
58+
rm -rf intro tutorials gallery projections
59+
rm -rf sg_execution_times.rst

doc/maintenance.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,25 @@ made to our documentation website every time we make a commit in a pull request.
120120
The service has a configuration file `.readthedocs.yaml`, with a list of options
121121
to change the default behaviour at <https://docs.readthedocs.io/en/stable/config-file/index.html>.
122122

123+
## Continuous Benchmarking
123124

124-
## Dependencies Policy
125+
We use the [CodSpeed](https://codspeed.io) service to continuously track PyGMT's
126+
performance. The `pytest-codspeed` plugin collects benchmark data and uploads it to the
127+
CodSpeed server, where results are available at <https://codspeed.io/GenericMappingTools/pygmt>.
125128

126-
PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the
127-
rest of the scientific Python ecosystem, and therefore:
129+
Benchmarking is handled through the `benchmarks.yml` GitHub Actions workflow. It's
130+
automatically executed when a pull request is merged into the main branch. To trigger
131+
benchmarking in a pull request, add the `run/benchmark` label to the pull request.
128132

129-
* Support for Python versions be dropped 3 years after their initial release.
130-
* Support for core package dependencies (NumPy, pandas, Xarray) be dropped 2 years after
131-
their initial release.
133+
To include a new test in the benchmark suite, apply the `@pytest.mark.benchmark`
134+
decorator to a test function.
132135

133-
Similarly, the PyGMT team has decided to discontinue support for GMT versions 3 years
134-
after their initial release.
136+
## Dependencies Policy
137+
138+
PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the
139+
rest of the scientific Python ecosystem, and made a few extensions based on the needs of
140+
the project. Please see [Minimum Supported Versions](minversions.md) for the detailed
141+
policy and the minimum supported versions of GMT, Python and core package dependencies.
135142

136143
In `pyproject.toml`, the `requires-python` key should be set to the minimum supported
137144
version of Python. Minimum supported versions of GMT, Python and core package

doc/minversions.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@ myst:
1818
# Minimum Supported Versions
1919

2020
PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the
21-
rest of the scientific Python ecosystem, and therefore:
21+
rest of the scientific Python ecosystem, and will therefore:
2222

23-
- Support for Python versions be dropped 3 years after their initial release.
24-
- Support for core package dependencies (NumPy, pandas, Xarray) be dropped 2 years after
25-
their initial release.
23+
- Drop support for Python versions 3 years after their initial release.
24+
- Drop support for core package dependencies (NumPy, pandas, Xarray) 2 years after their
25+
initial release.
2626

27-
Similarly, the PyGMT team has decided to discontinue support for GMT versions 3 years
28-
after their initial release.
27+
In addition to the above, the PyGMT team has also decided to:
28+
29+
- Drop support for GMT versions 3 years after their initial release, while ensuring at
30+
least two latest minor versions remain supported.
31+
- Maintain support for [optional dependencies](/ecosystem.md#pygmt-dependencies) for at
32+
least 1 year after their initial release. Users are encouraged to use the most
33+
up-to-date optional dependencies where possible.
34+
35+
:::{note}
36+
The SPEC 0 policy is enforced on a best-effort basis, and the PyGMT team may decide to
37+
drop support for core (and optional) package dependencies earlier than recommended for
38+
compatibility reasons.
39+
:::
2940

3041
| PyGMT Version | GMT | Python | NumPy | pandas | Xarray |
3142
|---|---|---|---|---|---|

0 commit comments

Comments
 (0)