Skip to content

Commit ecb5201

Browse files
authored
Merge branch 'main' into alias-system
2 parents c6ea4b8 + 215e4a1 commit ecb5201

Some content is hidden

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

75 files changed

+1097
-662
lines changed

.github/ISSUE_TEMPLATE/4-release_checklist.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ assignees: ''
2323
- [ ] All tests pass in the ["GMT Dev Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
2424
- [ ] All tests pass in the ["Doctests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)
2525
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r 'remove_version="vX.Y.Z"' pygmt` from the base of the repository
26+
- [ ] Update warnings in `pygmt.show_versions()` as well as notes in [Common installation issues](https://www.pygmt.org/dev/install.html#not-working-transparency)
27+
and [Testing your install]((https://www.pygmt.org/dev/install.html#testing-your-install) regarding GMT-Ghostscript incompatibility
2628
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
2729
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
2830
- [ ] Finish up 'Changelog entry for v0.x.x' Pull Request:

.github/workflows/benchmarks.yml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,43 @@ jobs:
3434
steps:
3535
# Checkout current git repository
3636
- name: Checkout
37-
uses: actions/[email protected].5
37+
uses: actions/[email protected].7
3838
with:
3939
# fetch all history so that setuptools-scm works
4040
fetch-depth: 0
4141

42-
# Install Miniconda with conda-forge dependencies
43-
- name: Setup Miniconda
44-
uses: conda-incubator/[email protected]
45-
with:
46-
auto-activate-base: true
47-
activate-environment: "" # base environment
48-
channels: conda-forge,nodefaults
49-
channel-priority: strict
42+
- name: Get current week number of year
43+
id: date
44+
run: echo "date=$(date +%Y-W%W)" >> $GITHUB_OUTPUT # e.g., 2024-W19
5045

51-
# Install GMT and dependencies from conda-forge
52-
- name: Install dependencies
53-
run: |
54-
# $CONDA is an environment variable pointing to the root of the miniconda directory
55-
# Preprend $CONDA/bin to $PATH so that conda's python is used over system python
56-
echo $CONDA/bin >> $GITHUB_PATH
57-
conda install --solver=libmamba gmt=6.5.0 python=3.12 \
58-
numpy pandas xarray netCDF4 packaging \
59-
geopandas pyarrow pytest pytest-mpl
60-
python -m pip install -U pytest-codspeed setuptools
46+
# Install Micromamba with conda-forge dependencies
47+
- name: Setup Micromamba
48+
uses: mamba-org/[email protected]
49+
with:
50+
environment-name: pygmt
51+
condarc: |
52+
channels:
53+
- conda-forge
54+
- nodefaults
55+
cache-downloads: false
56+
cache-environment: true
57+
# environment cache is persistent for one week.
58+
cache-environment-key: micromamba-environment-${{ steps.date.outputs.date }}
59+
create-args: >-
60+
gmt=6.5.0
61+
python=3.12
62+
numpy
63+
pandas
64+
xarray
65+
netCDF4
66+
packaging
67+
geopandas
68+
pyarrow
69+
pytest
70+
pytest-codspeed
71+
pytest-mpl
72+
pytest-rerunfailures
73+
pytest-xdist
6174
6275
# Download cached remote files (artifacts) from GitHub
6376
- name: Download remote data from GitHub
@@ -76,11 +89,8 @@ jobs:
7689

7790
# Run the benchmark tests
7891
- name: Run benchmarks
79-
uses: CodSpeedHQ/[email protected].1
92+
uses: CodSpeedHQ/[email protected].2
8093
with:
81-
run: |
82-
python -c "import pygmt; pygmt.show_versions()"
83-
PYGMT_USE_EXTERNAL_DISPLAY="false" python -m pytest -r P --pyargs pygmt --codspeed
84-
env:
85-
GMT_LIBRARY_PATH: /usr/share/miniconda/lib/
86-
PROJ_LIB: /usr/share/miniconda/share/proj
94+
# 'bash -el -c' is needed to use the custom shell.
95+
# See https://github.com/CodSpeedHQ/action/issues/65.
96+
run: bash -el -c "python -c \"import pygmt; pygmt.show_versions()\"; PYGMT_USE_EXTERNAL_DISPLAY=false python -m pytest -r P -n auto --reruns 2 --pyargs pygmt --codspeed"

.github/workflows/cache_data.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
steps:
3737
# Checkout current git repository
3838
- name: Checkout
39-
uses: actions/[email protected].5
39+
uses: actions/[email protected].7
4040
with:
4141
# fetch all history so that setuptools-scm works
4242
fetch-depth: 0
4343

4444
# Install Micromamba with conda-forge dependencies
4545
- name: Setup Micromamba
46-
uses: mamba-org/setup-micromamba@v1.8.1
46+
uses: mamba-org/setup-micromamba@v1.9.0
4747
with:
4848
environment-name: pygmt
4949
condarc: |

.github/workflows/check-links.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323

2424
steps:
2525
- name: Checkout the repository
26-
uses: actions/[email protected].5
26+
uses: actions/[email protected].7
2727
with:
2828
path: repository
2929

3030
- name: Checkout the documentation
31-
uses: actions/[email protected].5
31+
uses: actions/[email protected].7
3232
with:
3333
ref: gh-pages
3434
path: documentation
@@ -37,18 +37,21 @@ jobs:
3737
id: lychee
3838
uses: lycheeverse/[email protected]
3939
with:
40+
output: /tmp/lychee-out.md
4041
# 429: Too many requests
4142
args: >
4243
--accept 429
43-
--exclude-mail
4444
--exclude "^https://doi.org/10.5281/zenodo$"
4545
--exclude "^https://zenodo.org/badge/DOI/$"
4646
--exclude "^https://zenodo.org/badge/DOI/10.5281/zenodo$"
4747
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
4848
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
4949
--exclude "^https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z$"
50+
--exclude "^https://github.com/GenericMappingTools/pygmt/edit"
51+
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/new"
5052
--exclude "^git"
5153
--exclude "^file://"
54+
--exclude "https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf"
5255
--exclude "^https://docs.generic-mapping-tools.org/6.5/%s$"
5356
--exclude "^https://docs.generic-mapping-tools.org/6.5/%3Cmodule-name%3E.html$"
5457
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
@@ -69,7 +72,8 @@ jobs:
6972
- name: Create Issue From File
7073
if: env.lychee_exit_code != 0
7174
run: |
75+
cd repository/
7276
title="Link Checker Report on ${{ steps.date.outputs.date }}"
73-
gh issue create --title "$title" --body-file ./lychee/out.md
77+
gh issue create --title "$title" --body-file /tmp/lychee-out.md
7478
env:
7579
GH_TOKEN: ${{ github.token }}

.github/workflows/ci_docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
steps:
7070
# Checkout current git repository
7171
- name: Checkout
72-
uses: actions/[email protected].5
72+
uses: actions/[email protected].7
7373
with:
7474
# fetch all history so that setuptools-scm works
7575
fetch-depth: 0
@@ -80,7 +80,7 @@ jobs:
8080

8181
# Install Micromamba with conda-forge dependencies
8282
- name: Setup Micromamba
83-
uses: mamba-org/setup-micromamba@v1.8.1
83+
uses: mamba-org/setup-micromamba@v1.9.0
8484
with:
8585
environment-name: pygmt
8686
condarc: |
@@ -94,14 +94,14 @@ jobs:
9494
create-args: >-
9595
python=3.12
9696
gmt=6.5.0
97-
ghostscript=10.03.0
97+
ghostscript=10.03.1
9898
numpy
9999
pandas
100100
xarray
101101
netCDF4
102102
packaging
103103
contextily
104-
geopandas
104+
geopandas<1.0
105105
ipython
106106
rioxarray
107107
build
@@ -138,7 +138,7 @@ jobs:
138138
run: make -C doc clean all
139139

140140
- name: Checkout the gh-pages branch
141-
uses: actions/[email protected].5
141+
uses: actions/[email protected].7
142142
with:
143143
ref: gh-pages
144144
# Checkout to this folder instead of the current one

.github/workflows/ci_doctests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ jobs:
3535
steps:
3636
# Checkout current git repository
3737
- name: Checkout
38-
uses: actions/[email protected].5
38+
uses: actions/[email protected].7
3939
with:
4040
# fetch all history so that setuptools-scm works
4141
fetch-depth: 0
4242

4343
# Install Micromamba with conda-forge dependencies
4444
- name: Setup Micromamba
45-
uses: mamba-org/setup-micromamba@v1.8.1
45+
uses: mamba-org/setup-micromamba@v1.9.0
4646
with:
4747
environment-name: pygmt
4848
condarc: |

.github/workflows/ci_tests.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ jobs:
7070
# Only install optional packages on Python 3.12
7171
include:
7272
- python-version: '3.10'
73-
numpy-version: '1.23'
73+
numpy-version: '1.24'
7474
pandas-version: '=1.5'
7575
xarray-version: '=2022.06'
7676
optional-packages: ''
7777
- python-version: '3.12'
78-
numpy-version: '1.26'
78+
numpy-version: '2.0'
7979
pandas-version: ''
8080
xarray-version: ''
8181
optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery'
@@ -94,7 +94,7 @@ jobs:
9494
steps:
9595
# Checkout current git repository
9696
- name: Checkout
97-
uses: actions/[email protected].5
97+
uses: actions/[email protected].7
9898
with:
9999
# fetch all history so that setuptools-scm works
100100
fetch-depth: 0
@@ -105,7 +105,7 @@ jobs:
105105

106106
# Install Micromamba with conda-forge dependencies
107107
- name: Setup Micromamba
108-
uses: mamba-org/setup-micromamba@v1.8.1
108+
uses: mamba-org/setup-micromamba@v1.9.0
109109
with:
110110
environment-name: pygmt
111111
condarc: |
@@ -119,7 +119,7 @@ jobs:
119119
create-args: >-
120120
python=${{ matrix.python-version }}${{ matrix.optional-packages }}
121121
gmt=6.5.0
122-
ghostscript=10.03.0
122+
ghostscript=10.03.1
123123
numpy=${{ matrix.numpy-version }}
124124
pandas${{ matrix.pandas-version }}
125125
xarray${{ matrix.xarray-version }}
@@ -133,6 +133,8 @@ jobs:
133133
pytest-cov
134134
pytest-doctestplus
135135
pytest-mpl
136+
pytest-rerunfailures
137+
pytest-xdist
136138
137139
# Download cached remote files (artifacts) from GitHub
138140
- name: Download remote data from GitHub
@@ -147,27 +149,28 @@ jobs:
147149

148150
# Pull baseline image data from dvc remote (DAGsHub)
149151
- name: Pull baseline image data from dvc remote
150-
run: dvc pull --verbose && ls -lhR pygmt/tests/baseline/
152+
run: dvc pull --no-run-cache --verbose && ls -lhR pygmt/tests/baseline/
151153

152154
# Install the package that we want to test
153155
- name: Install the package
154156
run: make install
155157

156158
# Run the regular tests
157159
- name: Run tests
158-
run: make test PYTEST_EXTRA="-r P"
160+
run: make test PYTEST_EXTRA="-r P -n auto --reruns 2"
159161

160162
# Upload diff images on test failure
161163
- name: Upload diff images if any test fails
162164
uses: actions/upload-artifact@v4
163-
if: ${{ failure() }}
165+
if: failure()
164166
with:
165167
name: artifact-${{ runner.os }}-${{ matrix.python-version }}
166168
path: tmp-test-dir-with-unique-name
167169

168170
# Upload coverage to Codecov
169171
- name: Upload coverage to Codecov
170-
uses: codecov/[email protected]
172+
uses: codecov/[email protected]
173+
if: success() || failure()
171174
with:
172175
use_oidc: true
173176
file: ./coverage.xml # optional

0 commit comments

Comments
 (0)