Skip to content

Commit

Permalink
Merge branch 'main' into pytest/random
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Sep 27, 2024
2 parents 6bba926 + 89021cd commit 2c87d70
Show file tree
Hide file tree
Showing 221 changed files with 3,718 additions and 2,122 deletions.
42 changes: 22 additions & 20 deletions .github/ISSUE_TEMPLATE/4-release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,51 @@ assignees: ''
---

**Release**: [v0.x.x](https://github.com/GenericMappingTools/pygmt/milestones/?)
**Scheduled Date**: YYYY/MM/DD
**Pull request due date**: YYYY/MM/DD
**Scheduled Date**: 20YY/MM/DD
**Pull request due date**: 20YY/MM/DD
**DOI**: `10.5281/zenodo.XXXXXXX`

**Priority PRs/issues to complete prior to release**

- [ ] Wrap X ()
- [ ] Wrap Y ()

**Before release**:

- [ ] Check [SPEC 0](https://scientific-python.org/specs/spec-0000/) to see if we need to bump the minimum supported versions of GMT, Python and core package dependencies (NumPy/Pandas/Xarray)
- [ ] Run `make codespell` to check common misspellings. If there are any, either fix them or add them to `ignore-words-list` in `pyproject.toml`
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
- [ ] Check to ensure that:
- [ ] Deprecations and related tests are removed for this version by running `grep --include="*.py" -r vX.Y.Z` from the base of the repository
- [ ] All tests pass in the ["GMT Legacy Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_legacy.yaml)
- [ ] All tests pass in the ["GMT Dev Tests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
- [ ] All tests pass in the ["Doctests" workflow](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_doctests.yaml)
- [ ] 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
- [ ] Update warnings in `pygmt.show_versions()` as well as notes in [Common installation issues](https://www.pygmt.org/dev/install.html#not-working-transparency)
and [Testing your install]((https://www.pygmt.org/dev/install.html#testing-your-install) regarding GMT-Ghostscript incompatibility
- [ ] Update warnings in `pygmt/_show_versions.py` as well as notes in
[Not working transparency](https://www.pygmt.org/dev/install.html#not-working-transparency)
regarding GMT-Ghostscript incompatibility
- [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version"
- [ ] Review the ["PyGMT Team" page](https://www.pygmt.org/dev/team.html)
- [ ] Finish up 'Changelog entry for v0.x.x' Pull Request:
- [ ] Add a new entry in `doc/_static/version_switch.js` for documentation switcher
- [ ] Update `CITATION.cff` and BibTeX at https://github.com/GenericMappingTools/pygmt#citing-pygmt
- [ ] Update authorship list
- [ ] Update DOI (and url for BibTeX)
- [ ] Update version
- [ ] Update date released
- [ ] Add the documentation link `doc/minversions.md`
- [ ] Add minimum required version information `doc/minversions.md`
- [ ] 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))
- [ ] Finish up the "Changelog entry for v0.x.x" Pull Request (Use the previous changelog PR as a reference)
- [ ] Run `make codespell` to check common misspellings. If there are any, either fix them or add them to `ignore-words-list` in `pyproject.toml`
- [ ] Draft the announcement on https://hackmd.io/@pygmt

**Release**:

- [ ] At the [PyGMT release page on GitHub](https://github.com/GenericMappingTools/pygmt/releases):
- [ ] Edit the draft release notes with the finalized changelog
- [ ] Set the tag version and release title to vX.Y.Z
- [ ] Make a release by clicking the 'Publish Release' button, this will automatically create a tag too
- [ ] 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
- [ ] Download pygmt-X.Y.Z.zip (rename to pygmt-vX.Y.Z.zip) and baseline-images.zip from
the release page, and upload the two zip files to https://zenodo.org/deposit,
ensure that they are filed under the correct reserved DOI

**After release**:
- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock) [Done automatically by conda-forge's bot, but remember to pin SPEC0 versions]

- [ ] Update conda-forge [pygmt-feedstock](https://github.com/conda-forge/pygmt-feedstock)
[Done automatically by conda-forge's bot. Remember to pin Python and SPEC0 versions]
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
- [ ] Announce the release on:
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! draft on https://hackmd.io/@pygmt. requires moderator status)
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! Requires moderator status)
- [ ] [ResearchGate](https://www.researchgate.net) (after forum announcement, add new version as research item via the **code** category, be sure to include the corresponding new Zenodo DOI)

---

- [ ] Party :tada: (don't tick before all other checkboxes are ticked!)
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/5-bump_gmt_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using the following command:
**To-Do for bumping the minimum required GMT version**:

- [ ] Bump the minimum required GMT version (1 PR)
- [ ] Update `required_version` in `pygmt/clib/session.py`
- [ ] Update `required_gmt_version` in `pygmt/clib/__init__.py`
- [ ] Update `test_get_default` in `pygmt/tests/test_clib.py`
- [ ] Update minimum required versions in `doc/minversions.md`
- [ ] Remove unsupported GMT version from `.github/workflows/ci_tests_legacy.yaml`
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
Expand All @@ -45,7 +45,7 @@ jobs:

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.1
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand All @@ -69,9 +69,7 @@ jobs:
pytest
pytest-codspeed
pytest-mpl
pytest-rerunfailures
pytest-xdist
# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
run: |
Expand All @@ -89,7 +87,7 @@ jobs:

# Run the benchmark tests
- name: Run benchmarks
uses: CodSpeedHQ/action@v2.4.1
uses: CodSpeedHQ/action@v3.0.0
with:
# 'bash -el -c' is needed to use the custom shell.
# See https://github.com/CodSpeedHQ/action/issues/65.
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.1
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand All @@ -58,7 +58,7 @@ jobs:
xarray
netCDF4
packaging
build
python-build
# Install the package that we want to test
- name: Install the package
Expand All @@ -76,9 +76,10 @@ jobs:

# Upload the downloaded files as artifacts to GitHub
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.0
with:
name: gmt-cache
include-hidden-files: true
path: |
~/.gmt/cache
~/.gmt/server
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout the repository
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
path: repository

- name: Checkout the documentation
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
ref: gh-pages
path: documentation
Expand All @@ -37,18 +37,23 @@ jobs:
id: lychee
uses: lycheeverse/[email protected]
with:
output: /tmp/lychee-out.md
# 429: Too many requests
args: >
--accept 429
--exclude-mail
--exclude "^https://doi.org/10.5281/zenodo$"
--exclude "^https://zenodo.org/badge/DOI/$"
--exclude "^https://zenodo.org/badge/DOI/10.5281/zenodo$"
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
--exclude "^https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z$"
--exclude "^https://github.com/GenericMappingTools/pygmt/edit"
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/new"
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/tag/%7B%7Bpath%7D%7D"
--exclude "^https://www.pygmt.org/%7B%7Bpath%7D%7D"
--exclude "^git"
--exclude "^file://"
--exclude "https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf"
--exclude "^https://docs.generic-mapping-tools.org/6.5/%s$"
--exclude "^https://docs.generic-mapping-tools.org/6.5/%3Cmodule-name%3E.html$"
--exclude "^https://www.generic-mapping-tools.org/remote-datasets/%s$"
Expand All @@ -69,7 +74,8 @@ jobs:
- name: Create Issue From File
if: env.lychee_exit_code != 0
run: |
cd repository/
title="Link Checker Report on ${{ steps.date.outputs.date }}"
gh issue create --title "$title" --body-file ./lychee/out.md
gh issue create --title "$title" --body-file /tmp/lychee-out.md
env:
GH_TOKEN: ${{ github.token }}
14 changes: 7 additions & 7 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
Expand All @@ -80,7 +80,7 @@ jobs:

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.1
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand All @@ -94,20 +94,20 @@ jobs:
create-args: >-
python=3.12
gmt=6.5.0
ghostscript=10.03.0
ghostscript=10.04.0
numpy
pandas
xarray
netCDF4
packaging
contextily
geopandas
geopandas<1.0
ipython
rioxarray
build
make
pip
myst-parser
python-build
myst-nb
panel
sphinx
sphinx-autodoc-typehints
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
run: make -C doc clean all

- name: Checkout the gh-pages branch
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
ref: gh-pages
# Checkout to this folder instead of the current one
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_doctests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.1
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand All @@ -62,9 +62,9 @@ jobs:
ipython
pyarrow
rioxarray
build
make
pip
python-build
pytest
pytest-doctestplus
pytest-mpl
Expand Down
31 changes: 20 additions & 11 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,24 @@ jobs:
# Only install optional packages on Python 3.12
include:
- python-version: '3.10'
numpy-version: '1.23'
numpy-version: '1.24'
pandas-version: '=1.5'
xarray-version: '=2022.06'
xarray-version: '=2022.09'
optional-packages: ''
- python-version: '3.12'
numpy-version: '1.26'
numpy-version: '2.1'
pandas-version: ''
xarray-version: ''
optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery'
# The job below is for testing geopandas v0.x on Ubuntu.
# The python-version here can't be the versions in the matrix.python-version
# defined above. Otherwise, other jobs will be overridden by this one.
- os: 'ubuntu-latest'
python-version: '3.11' # Can't be 3.10 or 3.12.
numpy-version: '1.24'
pandas-version: ''
xarray-version: ''
optional-packages: ' geopandas<1'

timeout-minutes: 30
defaults:
Expand All @@ -94,7 +103,7 @@ jobs:
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected].5
uses: actions/[email protected].7
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
Expand All @@ -105,7 +114,7 @@ jobs:

# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1.8.1
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: pygmt
condarc: |
Expand All @@ -119,16 +128,16 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}${{ matrix.optional-packages }}
gmt=6.5.0
ghostscript=10.03.0
ghostscript=10.04.0
numpy=${{ matrix.numpy-version }}
pandas${{ matrix.pandas-version }}
xarray${{ matrix.xarray-version }}
netCDF4
packaging
build
dvc
make
pip
python-build
pytest
pytest-cov
pytest-doctestplus
Expand All @@ -150,27 +159,27 @@ jobs:

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

# Install the package that we want to test
- name: Install the package
run: make install

# Run the regular tests
- name: Run tests
run: make test PYTEST_EXTRA="-r P"
run: make test PYTEST_EXTRA="-r P -n auto --reruns 2"

# Upload diff images on test failure
- name: Upload diff images if any test fails
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.0
if: failure()
with:
name: artifact-${{ runner.os }}-${{ matrix.python-version }}
path: tmp-test-dir-with-unique-name

# Upload coverage to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.4.0
uses: codecov/codecov-action@v4.5.0
if: success() || failure()
with:
use_oidc: true
Expand Down
Loading

0 comments on commit 2c87d70

Please sign in to comment.