Skip to content

Commit d330c1c

Browse files
author
Max Jones
authored
Merge branch 'main' into wrap-clip
2 parents 57dc352 + d04d74a commit d330c1c

File tree

128 files changed

+3038
-806
lines changed

Some content is hidden

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

128 files changed

+3038
-806
lines changed

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ assignees: ''
2121
- [ ] Finish up 'Changelog entry for v0.x.x' Pull Request:
2222
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
2323
- [ ] Update `CITATION.cff` and BibTeX at https://github.com/GenericMappingTools/pygmt#citing-pygmt
24-
- [ ] Add the documentation link https://github.com/GenericMappingTools/pygmt#documentation-for-other-versions
25-
- [ ] Add compatibility information https://github.com/GenericMappingTools/pygmt#compatibility-with-gmt-and-pythonnumpy-versions
24+
- [ ] Update authorship list
25+
- [ ] Update DOI (and url for BibTeX)
26+
- [ ] Update version
27+
- [ ] Update date released
28+
- [ ] Add the documentation link https://github.com/GenericMappingTools/pygmt#compatibility-with-gmtpythonnumpy-versions
29+
- [ ] Add compatibility information https://github.com/GenericMappingTools/pygmt#compatibility-with-gmtpythonnumpy-versions
2630
- [ ] Copy draft changelog from Release Drafter and edit it to look nice ([see maintainers guide for details](https://www.pygmt.org/dev/maintenance.html#updating-the-changelog))
2731

2832
**Release**:
@@ -33,11 +37,10 @@ assignees: ''
3337
- [ ] Manually upload the pygmt-vX.Y.Z.zip and baseline-images.zip files to https://zenodo.org/deposit, ensure that it is filed under the correct reserved DOI
3438

3539
**After release**:
36-
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Usually done automatically by conda-forge's bot]
40+
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Done automatically by conda-forge's bot, but remember to pin NEP29 versions]
3741
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
3842
- [ ] Announce the release on:
3943
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! draft on https://hackmd.io/@pygmt. requires moderator status)
40-
- [ ] [Major/Minor releases only] GMT [website](https://github.com/GenericMappingTools/website) (News)
4144
- [ ] [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools) (after forum announcement)
4245
- [ ] [Twitter](https://twitter.com/gmt_dev) (after forum announcement)
4346
---

.github/workflows/cache_data.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
# Checkout current git repository
2121
- name: Checkout
22-
uses: actions/checkout@v2.4.0
22+
uses: actions/checkout@v3.0.2
2323
with:
2424
# fecth all history so that setuptools-scm works
2525
fetch-depth: 0
@@ -38,13 +38,13 @@ jobs:
3838
# Install GMT and other required dependencies from conda-forge
3939
- name: Install dependencies
4040
run: |
41-
mamba install gmt=6.3.0 \
42-
numpy pandas xarray netCDF4 packaging matplotlib
41+
mamba install gmt=6.3.0 numpy pandas xarray netCDF4 packaging \
42+
build
4343
4444
# Install the package that we want to test
4545
- name: Install the package
4646
run: |
47-
python setup.py sdist --formats=zip
47+
python -m build --sdist
4848
pip install dist/*
4949
5050
# Download remote files
@@ -54,7 +54,7 @@ jobs:
5454
5555
# Upload the downloaded files as artifacts to GitHub
5656
- name: Upload artifacts to GitHub
57-
uses: actions/upload-artifact@v2
57+
uses: actions/upload-artifact@v3
5858
with:
5959
name: gmt-cache
6060
path: |

.github/workflows/check-links.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515

1616
steps:
1717
- name: Checkout the repository
18-
uses: actions/checkout@v2.4.0
18+
uses: actions/checkout@v3.0.2
1919
with:
2020
path: repository
2121

2222
- name: Checkout the documentation
23-
uses: actions/checkout@v2.4.0
23+
uses: actions/checkout@v3.0.2
2424
with:
2525
ref: gh-pages
2626
path: documentation
2727

2828
- name: Link Checker
29-
uses: lycheeverse/lychee-action@v1.3.1
29+
uses: lycheeverse/lychee-action@v1.5.0
3030
with:
3131
# 429: Too many requests
3232
args: >
@@ -41,7 +41,9 @@ jobs:
4141
--exclude "^file://"
4242
--exclude "^https://docs.generic-mapping-tools.org/latest/%s$"
4343
--exclude "^https://docs.generic-mapping-tools.org/latest/%3Cmodule-name%3E.html$"
44-
--exclude "https://hackmd.io/@pygmt"
44+
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
45+
--exclude "^https://hackmd.io/@pygmt"
46+
--exclude "^https://doi.org"
4547
--verbose
4648
"repository/**/*.rst"
4749
"repository/**/*.md"
@@ -55,7 +57,7 @@ jobs:
5557
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
5658

5759
- name: Create Issue From File
58-
uses: peter-evans/create-issue-from-file@v3
60+
uses: peter-evans/create-issue-from-file@v4
5961
with:
6062
title: Link Checker Report on ${{ steps.date.outputs.date }}
6163
content-filepath: ./lychee/out.md

.github/workflows/ci_docs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
python-version: ['3.9']
27+
python-version: ['3.10']
2828
os: [ubuntu-latest, macOS-latest, windows-latest]
2929
# Is it a draft Pull Request (true or false)?
3030
isDraft:
3131
- ${{ github.event.pull_request.draft }}
32-
# Only run one job (Ubuntu + Python 3.9) for draft PRs
32+
# Only run one job (Ubuntu + Python 3.10) for draft PRs
3333
exclude:
3434
- os: macOS-latest
3535
isDraft: true
@@ -49,7 +49,7 @@ jobs:
4949

5050
# Checkout current git repository
5151
- name: Checkout
52-
uses: actions/checkout@v2.4.0
52+
uses: actions/checkout@v3.0.2
5353
with:
5454
# fecth all history so that setuptools-scm works
5555
fetch-depth: 0
@@ -71,7 +71,7 @@ jobs:
7171
- name: Install dependencies
7272
run: |
7373
mamba install gmt=6.3.0 numpy pandas xarray netCDF4 packaging \
74-
ipython make myst-parser geopandas \
74+
build ipython make myst-parser geopandas \
7575
sphinx sphinx-copybutton sphinx-gallery sphinx_rtd_theme
7676
7777
# Show installed pkg information for postmortem diagnostic
@@ -80,7 +80,7 @@ jobs:
8080

8181
# Download cached remote files (artifacts) from GitHub
8282
- name: Download remote data from GitHub
83-
uses: dawidd6/action-download-artifact@v2.17.0
83+
uses: dawidd6/action-download-artifact@v2.20.0
8484
with:
8585
workflow: cache_data.yaml
8686
workflow_conclusion: success
@@ -99,15 +99,15 @@ jobs:
9999
# Install the package that we want to test
100100
- name: Install the package
101101
run: |
102-
python setup.py sdist --formats=zip
102+
python -m build --sdist
103103
pip install dist/*
104104
105105
# Build the documentation
106106
- name: Build the documentation
107107
run: make -C doc clean all
108108

109109
- name: Checkout the gh-pages branch
110-
uses: actions/checkout@v2.4.0
110+
uses: actions/checkout@v3.0.2
111111
with:
112112
ref: gh-pages
113113
# Checkout to this folder instead of the current one

.github/workflows/ci_tests.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ['3.8', '3.9']
32+
python-version: ['3.8', '3.10']
3333
os: [ubuntu-latest, macOS-latest, windows-latest]
3434
# Is it a draft Pull Request (true or false)?
3535
isDraft:
3636
- ${{ github.event.pull_request.draft }}
37-
# Only run one job (Ubuntu + Python 3.9) for draft PRs
37+
# Only run one job (Ubuntu + Python 3.10) for draft PRs
3838
exclude:
3939
- os: macOS-latest
4040
isDraft: true
@@ -43,13 +43,13 @@ jobs:
4343
# - os: ubuntu-latest
4444
# python-version: 3.7
4545
# isDraft: true
46-
# Pair Python 3.8 with NumPy 1.19 and Python 3.9 with NumPy 1.22
47-
# Only install optional packages on Python 3.9/NumPy 1.22
46+
# Pair Python 3.8 with NumPy 1.19 and Python 3.10 with NumPy 1.22
47+
# Only install optional packages on Python 3.10/NumPy 1.22
4848
include:
4949
- python-version: '3.8'
5050
numpy-version: '1.19'
5151
optional-packages: ''
52-
- python-version: '3.9'
52+
- python-version: '3.10'
5353
numpy-version: '1.22'
5454
optional-packages: 'geopandas ipython'
5555
timeout-minutes: 30
@@ -72,7 +72,7 @@ jobs:
7272

7373
# Checkout current git repository
7474
- name: Checkout
75-
uses: actions/checkout@v2.4.0
75+
uses: actions/checkout@v3.0.2
7676
with:
7777
# fecth all history so that setuptools-scm works
7878
fetch-depth: 0
@@ -96,16 +96,16 @@ jobs:
9696
mamba install gmt=6.3.0 numpy=${{ matrix.numpy-version }} \
9797
pandas xarray netCDF4 packaging \
9898
${{ matrix.optional-packages }} \
99-
dvc make pytest>=6.0 \
100-
pytest-cov pytest-mpl sphinx-gallery tomli
99+
build dvc make pytest>=6.0 \
100+
pytest-cov pytest-doctestplus pytest-mpl sphinx-gallery tomli
101101
102102
# Show installed pkg information for postmortem diagnostic
103103
- name: List installed packages
104104
run: mamba list
105105

106106
# Download cached remote files (artifacts) from GitHub
107107
- name: Download remote data from GitHub
108-
uses: dawidd6/action-download-artifact@v2.17.0
108+
uses: dawidd6/action-download-artifact@v2.20.0
109109
with:
110110
workflow: cache_data.yaml
111111
workflow_conclusion: success
@@ -130,24 +130,30 @@ jobs:
130130
# Install the package that we want to test
131131
- name: Install the package
132132
run: |
133-
python setup.py sdist --formats=zip
133+
python -m build --sdist
134134
pip install dist/*
135135
136-
# Run the tests
137-
- name: Test with pytest
136+
# Run the regular tests
137+
- name: Run tests
138+
if: github.event.schedule != '0 0 * * 3'
138139
run: make test PYTEST_EXTRA="-r P"
139140

141+
# Run full tests including doctests on Wednesday
142+
- name: Run full tests
143+
if: github.event_name == 'schedule' && github.event.schedule == '0 0 * * 3'
144+
run: make fulltest PYTEST_EXTRA="-r P"
145+
140146
# Upload diff images on test failure
141147
- name: Upload diff images if any test fails
142-
uses: actions/upload-artifact@v2
148+
uses: actions/upload-artifact@v3
143149
if: ${{ failure() }}
144150
with:
145151
name: artifact-${{ runner.os }}-${{ matrix.python-version }}
146152
path: tmp-test-dir-with-unique-name
147153

148154
# Upload coverage to Codecov
149155
- name: Upload coverage to Codecov
150-
uses: codecov/codecov-action@v2.1.0
156+
uses: codecov/codecov-action@v3.1.0
151157
with:
152158
file: ./coverage.xml # optional
153159
env_vars: OS,PYTHON,NUMPY

.github/workflows/ci_tests_dev.yaml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ on:
1717
- '.gitignore'
1818
repository_dispatch:
1919
types: [test-gmt-dev-command]
20-
# Schedule daily tests
20+
# Schedule tests on Monday/Wednesday/Friday
2121
schedule:
22-
- cron: '0 0 * * *'
22+
- cron: '0 0 * * 1,3,5'
2323

2424
jobs:
2525
test_gmt_dev:
@@ -45,7 +45,7 @@ jobs:
4545

4646
# Checkout current git repository
4747
- name: Checkout
48-
uses: actions/checkout@v2.4.0
48+
uses: actions/checkout@v3.0.2
4949
if: github.event_name != 'repository_dispatch'
5050
with:
5151
# fecth all history so that setuptools-scm works
@@ -62,15 +62,24 @@ jobs:
6262

6363
# Checkout the pull request branch
6464
- name: Checkout
65-
uses: actions/checkout@v2.4.0
65+
uses: actions/checkout@v3.0.2
6666
if: github.event_name == 'repository_dispatch'
6767
with:
6868
token: ${{ steps.generate-token.outputs.token }}
6969
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
70-
ref: ${{ github.event.pull_request.head.sha }}
70+
ref: ${{ github.event.client_payload.pull_request.head.ref }}
7171
# fecth all history so that setuptools-scm works
7272
fetch-depth: 0
7373

74+
- name: Show job URL
75+
uses: peter-evans/create-or-update-comment@v2.0.0
76+
if: github.event_name == 'repository_dispatch' && (matrix.os == 'ubuntu-latest')
77+
with:
78+
token: ${{ steps.generate-token.outputs.token }}
79+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
80+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
81+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
82+
7483
# Install Mambaforge with conda-forge dependencies
7584
- name: Setup Mambaforge
7685
uses: conda-incubator/setup-miniconda@v2.1.1
@@ -92,11 +101,24 @@ jobs:
92101
geopandas ghostscript libnetcdf hdf5 zlib curl pcre make
93102
pip install --pre --prefer-binary \
94103
numpy pandas xarray netCDF4 packaging \
95-
dvc ipython 'pytest>=6.0' pytest-cov \
96-
pytest-mpl sphinx-gallery tomli
104+
build dvc ipython 'pytest>=6.0' pytest-cov \
105+
pytest-doctestplus pytest-mpl sphinx-gallery tomli
106+
107+
# Pull baseline image data from dvc remote (DAGsHub)
108+
- name: Pull baseline image data from dvc remote
109+
if: github.event_name == 'schedule'
110+
run: |
111+
ORIGINAL_BRANCH=$(git branch --show-current)
112+
# Pull down GMT 6.4 baseline images from the gmt-6.4 branch
113+
# https://github.com/GenericMappingTools/pygmt/pull/1883
114+
git checkout gmt-6.4
115+
dvc pull
116+
ls -lhR pygmt/tests/baseline/
117+
git checkout ${ORIGINAL_BRANCH}
97118
98119
# Pull baseline image data from dvc remote (DAGsHub)
99120
- name: Pull baseline image data from dvc remote
121+
if: github.event_name != 'schedule'
100122
run: |
101123
dvc pull
102124
ls -lhR pygmt/tests/baseline/
@@ -115,7 +137,7 @@ jobs:
115137

116138
# Download cached remote files (artifacts) from GitHub
117139
- name: Download remote data from GitHub
118-
uses: dawidd6/action-download-artifact@v2.17.0
140+
uses: dawidd6/action-download-artifact@v2.20.0
119141
with:
120142
workflow: cache_data.yaml
121143
workflow_conclusion: success
@@ -131,11 +153,10 @@ jobs:
131153
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
132154
ls -lhR ~/.gmt
133155
134-
135156
# Install the package that we want to test
136157
- name: Install the package
137158
run: |
138-
python setup.py sdist --formats=zip
159+
python -m build --sdist
139160
pip install dist/*
140161
141162
- name: Add GMT's bin to PATH (Linux/macOS)
@@ -156,17 +177,8 @@ jobs:
156177

157178
# Upload diff images on test failure
158179
- name: Upload diff images if any test fails
159-
uses: actions/upload-artifact@v2
180+
uses: actions/upload-artifact@v3
160181
if: ${{ failure() }}
161182
with:
162183
name: artifact-GMT-${{ matrix.gmt_git_ref }}-${{ runner.os }}
163184
path: tmp-test-dir-with-unique-name
164-
165-
- name: Add reaction
166-
uses: peter-evans/create-or-update-comment@v1
167-
if: github.event_name == 'repository_dispatch'
168-
with:
169-
token: ${{ steps.generate-token.outputs.token }}
170-
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
171-
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
172-
reaction-type: hooray

0 commit comments

Comments
 (0)