Skip to content

Commit a7fd123

Browse files
committed
Merge branch 'main' into sphinx-gallery-optional
2 parents ff0ba37 + 798744d commit a7fd123

Some content is hidden

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

45 files changed

+647
-403
lines changed

.github/ISSUE_TEMPLATE/bump_gmt_checklist.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ assignees: ''
1717
**To-Do for bumping the GMT version in CI**:
1818

1919
- [ ] Bump the GMT version in CI (1 PR)
20+
- [ ] Update `environment.yml`
21+
- [ ] Update `ci/requirements/docs.yml`
2022
- [ ] Update `.github/workflows/cache_data.yaml`
23+
- [ ] Update `.github/workflows/ci_doctests.yaml`
2124
- [ ] Update `.github/workflows/ci_docs.yml`
2225
- [ ] Update `.github/workflows/ci_tests.yaml`
23-
- [ ] Update `ci/requirements/docs.yml`
24-
- [ ] Update `environment.yml`
26+
- [ ] Add the legacy GMT version to `.github/workflows/ci_tests_legacy.yaml`
2527
- [ ] Fix failing tests (1 or more PRs)
2628
- [ ] Fix [xfail](https://docs.pytest.org/en/stable/skipping.html#xfail-mark-test-functions-as-expected-to-fail) pytest markers on tests that are now xpass
2729

2830
**To-Do for bumping the minimum required GMT version**:
2931

3032
- [ ] Bump the minimum required GMT version (1 PR)
31-
- [ ] Update `doc/install.rst`
3233
- [ ] Update `required_version` in `pygmt/clib/session.py`
3334
- [ ] Update `test_get_default` in `pygmt/tests/test_clib.py`
3435
- [ ] Update compatibility table in `README.rst`
36+
- [ ] Remove unsupported GMT version from `.github/workflows/ci_tests_legacy.yaml`
3537
- [ ] Remove [xfail](https://docs.pytest.org/en/stable/skipping.html#xfail-mark-test-functions-as-expected-to-fail) pytest markers on tests that are now xpass
3638
- [ ] Update deprecated syntax in source code and examples based on the [GMT Changelog](https://docs.generic-mapping-tools.org/latest/changes.html)

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ assignees: ''
4444
- [ ] Bump PyGMT version on https://github.com/GenericMappingTools/try-gmt (after conda-forge update)
4545
- [ ] Announce the release on:
4646
- [ ] GMT [forum](https://forum.generic-mapping-tools.org/c/news/) (do this announcement first! draft on https://hackmd.io/@pygmt. requires moderator status)
47-
- [ ] [ResearchGate](https://www.researchgate.net/project/PyGMT-A-Python-interface-for-the-Generic-Mapping-Tools) (after forum announcement)
4847
- [ ] [Twitter](https://twitter.com/gmt_dev) (after forum announcement)
4948
---
5049

.github/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ categories:
2020
label: 'maintenance'
2121
exclude-labels:
2222
- 'skip-changelog'
23+
exclude-contributors:
24+
- 'actions-bot'
25+
- 'dependabot'
26+
- 'dependabot[bot]'
2327
category-template: '### $TITLE'
2428
change-template: '* $TITLE ([#$NUMBER]($URL))'
2529
sort-by: 'title'

.github/workflows/cache_data.yaml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
# This workflow gets and uploads the GMT data artifacts used in the PyGMT CI tests
1+
# Cache GMT remote data files and uploads as artifacts
2+
#
3+
# This workflow downloads data files needed by PyGMT tests/documentation from
4+
# the GMT data server and uploads as workflow artifacts which can be accessed
5+
# by other GitHub Actions workflows.
6+
#
7+
# It is scheduled to run every Sunday at 12:00 (UTC). If new remote files are
8+
# needed urgently, maintainers can manually uncomment the 'pull_request:' line
9+
# below to refresh the cache.
10+
#
211
name: Cache data
312

413
on:
@@ -11,42 +20,40 @@ on:
1120
jobs:
1221
gmt_cache:
1322
name: Cache GMT artifacts
14-
runs-on: macOS-latest
23+
runs-on: macos-latest
1524
defaults:
1625
run:
1726
shell: bash -l {0}
1827

1928
steps:
2029
# Checkout current git repository
2130
- name: Checkout
22-
uses: actions/[email protected].0
31+
uses: actions/[email protected].2
2332
with:
2433
# fetch all history so that setuptools-scm works
2534
fetch-depth: 0
2635

27-
# Install Mambaforge with conda-forge dependencies
28-
- name: Setup Mambaforge
29-
uses: conda-incubator/[email protected]
36+
- name: Setup Micromamba
37+
uses: mamba-org/provision-with-micromamba@v15
3038
with:
39+
environment-name: pygmt
40+
environment-file: false
3141
channels: conda-forge,nodefaults
32-
channel-priority: strict
33-
miniforge-version: latest
34-
miniforge-variant: Mambaforge
35-
mamba-version: "*"
36-
run-post: false
37-
use-mamba: true
38-
39-
# Install GMT and other required dependencies from conda-forge
40-
- name: Install dependencies
41-
run: |
42-
mamba install gmt=6.4.0 numpy pandas xarray netCDF4 packaging \
43-
build
42+
extra-specs: |
43+
python=3.11
44+
gmt=6.4.0
45+
numpy
46+
pandas
47+
xarray
48+
netCDF4
49+
packaging
50+
build
4451
4552
# Install the package that we want to test
4653
- name: Install the package
4754
run: |
4855
python -m build --sdist
49-
pip install dist/*
56+
python -m pip install dist/*
5057
5158
# Download remote files
5259
- name: Download remote data

.github/workflows/check-links.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# This workflow checks the links in plaintext and HTML files
1+
# Check links in the repository and documentation
2+
#
3+
# This workflow runs the lychee tool to check all external links in plaintext
4+
# and HTML files. It will create an issue if broken links are found.
5+
#
6+
# It is scheduled to run weekly at 12 noon every Sunday.
7+
#
28
name: Check Links
39

410
on:
@@ -15,19 +21,19 @@ jobs:
1521

1622
steps:
1723
- name: Checkout the repository
18-
uses: actions/[email protected].0
24+
uses: actions/[email protected].2
1925
with:
2026
path: repository
2127

2228
- name: Checkout the documentation
23-
uses: actions/[email protected].0
29+
uses: actions/[email protected].2
2430
with:
2531
ref: gh-pages
2632
path: documentation
2733

2834
- name: Link Checker
2935
id: lychee
30-
uses: lycheeverse/lychee-action@v1.6.1
36+
uses: lycheeverse/lychee-action@v1.7.0
3137
with:
3238
# 429: Too many requests
3339
args: >

.github/workflows/ci_docs.yml

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
# This workflow installs PyGMT, builds and deploys documentation
2-
1+
# Build and deploy documentation
2+
#
3+
# This workflow builds the documentation on Linux/macOS/Windows.
4+
#
5+
# It is run on every commit to the main and pull request branches, and also
6+
# when a new release is published.
7+
# In draft pull requests, only the job on Linux is triggered to save on
8+
# Continuous Integration resources.
9+
#
10+
# On the main branch, the workflow also handles the documentation deployment:
11+
#
12+
# * Updating the development documentation by pushing the built HTML pages
13+
# from the main branch onto the dev folder of the gh-pages branch.
14+
# * Updating the latest documentation link to the new release.
15+
#
316
name: Docs
417

518
on:
@@ -18,19 +31,18 @@ on:
1831

1932
jobs:
2033
docs:
21-
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
34+
name: ${{ matrix.os }}
2235
runs-on: ${{ matrix.os }}
2336
strategy:
2437
fail-fast: false
2538
matrix:
26-
python-version: ['3.11']
27-
os: [ubuntu-latest, macOS-latest, windows-latest]
39+
os: [ubuntu-latest, macos-latest, windows-latest]
2840
# Is it a draft Pull Request (true or false)?
2941
isDraft:
3042
- ${{ github.event.pull_request.draft }}
3143
# Only run one job (Ubuntu + Python 3.11) for draft PRs
3244
exclude:
33-
- os: macOS-latest
45+
- os: macos-latest
3446
isDraft: true
3547
- os: windows-latest
3648
isDraft: true
@@ -48,39 +60,44 @@ jobs:
4860

4961
# Checkout current git repository
5062
- name: Checkout
51-
uses: actions/[email protected].0
63+
uses: actions/[email protected].2
5264
with:
5365
# fetch all history so that setuptools-scm works
5466
fetch-depth: 0
5567

56-
# Install Mambaforge with conda-forge dependencies
57-
- name: Setup Mambaforge
58-
uses: conda-incubator/[email protected]
68+
- name: Setup Micromamba
69+
uses: mamba-org/provision-with-micromamba@v15
5970
with:
60-
activate-environment: pygmt
61-
python-version: ${{ matrix.python-version }}
71+
environment-name: pygmt
72+
environment-file: false
6273
channels: conda-forge,nodefaults
63-
channel-priority: strict
64-
miniforge-version: latest
65-
miniforge-variant: Mambaforge
66-
mamba-version: "*"
67-
run-post: false
68-
use-mamba: true
69-
70-
# Install GMT and other required dependencies from conda-forge
71-
- name: Install dependencies
72-
run: |
73-
mamba install gmt=6.4.0 numpy pandas xarray netCDF4 packaging \
74-
build ipython make myst-parser contextily geopandas rioxarray \
75-
sphinx sphinx-copybutton sphinx-design sphinx-gallery sphinx_rtd_theme
76-
77-
# Show installed pkg information for postmortem diagnostic
78-
- name: List installed packages
79-
run: mamba list
74+
cache-downloads: true
75+
cache-env: true
76+
extra-specs: |
77+
python=3.11
78+
gmt=6.4.0
79+
numpy
80+
pandas
81+
xarray
82+
netCDF4
83+
packaging
84+
contextily
85+
geopandas
86+
ipython
87+
rioxarray
88+
build
89+
make
90+
pip
91+
myst-parser
92+
sphinx
93+
sphinx-copybutton
94+
sphinx-design
95+
sphinx-gallery
96+
sphinx_rtd_theme
8097
8198
# Download cached remote files (artifacts) from GitHub
8299
- name: Download remote data from GitHub
83-
uses: dawidd6/action-download-artifact@v2.26.1
100+
uses: dawidd6/action-download-artifact@v2.27.0
84101
with:
85102
workflow: cache_data.yaml
86103
workflow_conclusion: success
@@ -100,14 +117,14 @@ jobs:
100117
- name: Install the package
101118
run: |
102119
python -m build --sdist
103-
pip install dist/*
120+
python -m pip install dist/*
104121
105122
# Build the documentation
106123
- name: Build the documentation
107124
run: make -C doc clean all
108125

109126
- name: Checkout the gh-pages branch
110-
uses: actions/[email protected].0
127+
uses: actions/[email protected].2
111128
with:
112129
ref: gh-pages
113130
# Checkout to this folder instead of the current one

.github/workflows/ci_doctests.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Run all doctests on Linux/macOS/Windows
2+
#
3+
# This workflow runs all PyGMT doctests. It is scheduled to run weekly every
4+
# Sunday.
5+
#
6+
name: Doctests
7+
8+
on:
9+
# push:
10+
# branches: [ main ]
11+
# pull_request:
12+
# Schedule weekly tests on Sunday
13+
schedule:
14+
- cron: '0 0 * * 0'
15+
16+
jobs:
17+
test:
18+
name: ${{ matrix.os }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
timeout-minutes: 30
25+
defaults:
26+
run:
27+
shell: bash -l {0}
28+
29+
steps:
30+
# Cancel previous runs that are not completed
31+
- name: Cancel Previous Runs
32+
uses: styfle/[email protected]
33+
with:
34+
access_token: ${{ github.token }}
35+
36+
# Checkout current git repository
37+
- name: Checkout
38+
uses: actions/[email protected]
39+
with:
40+
# fetch all history so that setuptools-scm works
41+
fetch-depth: 0
42+
43+
- name: Setup Micromamba
44+
uses: mamba-org/provision-with-micromamba@v15
45+
with:
46+
environment-name: pygmt
47+
environment-file: false
48+
channels: conda-forge,nodefaults
49+
extra-specs: |
50+
python=3.11
51+
gmt=6.4.0
52+
numpy
53+
pandas
54+
xarray
55+
netCDF4
56+
packaging
57+
contextily
58+
geopandas
59+
ipython
60+
rioxarray
61+
build
62+
make
63+
pip
64+
pytest
65+
pytest-doctestplus
66+
pytest-mpl
67+
sphinx-gallery
68+
69+
# Download cached remote files (artifacts) from GitHub
70+
- name: Download remote data from GitHub
71+
uses: dawidd6/[email protected]
72+
with:
73+
workflow: cache_data.yaml
74+
workflow_conclusion: success
75+
name: gmt-cache
76+
path: .gmt
77+
78+
# Move downloaded files to ~/.gmt directory and list them
79+
- name: Move and list downloaded remote files
80+
run: |
81+
mkdir -p ~/.gmt
82+
mv .gmt/* ~/.gmt
83+
# Change modification times of the two files, so GMT won't refresh it
84+
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
85+
ls -lhR ~/.gmt
86+
87+
# Install the package that we want to test
88+
- name: Install the package
89+
run: make install
90+
91+
# Run the doctests
92+
- name: Run doctests
93+
run: make doctest PYTEST_EXTRA="-r P"

0 commit comments

Comments
 (0)