Skip to content

Commit a7b6f3d

Browse files
authored
Merge branch 'master' into docstring-formatter
2 parents 2557e8f + 5f8a084 commit a7b6f3d

Some content is hidden

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

42 files changed

+883
-244
lines changed

.github/workflows/ci_tests.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
push:
88
branches: [ master ]
99
pull_request:
10+
release:
11+
types:
12+
- published
1013
# Schedule daily tests
1114
schedule:
1215
- cron: '0 0 * * *'
@@ -138,3 +141,64 @@ jobs:
138141
file: ./coverage.xml # optional
139142
env_vars: OS,PYTHON
140143
fail_ci_if_error: true
144+
145+
- name: Checkout the gh-pages branch
146+
uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b
147+
with:
148+
ref: gh-pages
149+
# Checkout to this folder instead of the current one
150+
path: deploy
151+
# Download the entire history
152+
fetch-depth: 0
153+
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')
154+
155+
- name: Push the built HTML to gh-pages
156+
run: |
157+
# Detect if this is a release or from the master branch
158+
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
159+
# Get the tag name without the "refs/tags/" part
160+
version="${GITHUB_REF#refs/*/}"
161+
else
162+
version=dev
163+
fi
164+
echo "Deploying version: $version"
165+
# Make the new commit message. Needs to happen before cd into deploy
166+
# to get the right commit hash.
167+
message="Deploy $version from $(git rev-parse --short HEAD)"
168+
cd deploy
169+
# Need to have this file so that Github doesn't try to run Jekyll
170+
touch .nojekyll
171+
# Delete all the files and replace with our new set
172+
echo -e "\nRemoving old files from previous builds of ${version}:"
173+
rm -rvf ${version}
174+
echo -e "\nCopying HTML files to ${version}:"
175+
cp -Rvf ../doc/_build/html/ ${version}/
176+
# If this is a new release, update the link from /latest to it
177+
if [[ "${version}" != "dev" ]]; then
178+
echo -e "\nSetup link from ${version} to 'latest'."
179+
rm -f latest
180+
ln -sf ${version} latest
181+
fi
182+
# Stage the commit
183+
git add -A .
184+
echo -e "\nChanges to be applied:"
185+
git status
186+
# Configure git to be the GitHub Actions account
187+
git config user.email "github-actions[bot]@users.noreply.github.com"
188+
git config user.name "github-actions[bot]"
189+
# If this is a dev build and the last commit was from a dev build
190+
# (detect if "dev" was in the previous commit message), reuse the
191+
# same commit
192+
if [[ "${version}" == "dev" && `git log -1 --format='%s'` == *"dev"* ]]; then
193+
echo -e "\nAmending last commit:"
194+
git commit --amend --reset-author -m "$message"
195+
else
196+
echo -e "\nMaking a new commit:"
197+
git commit -m "$message"
198+
fi
199+
# Make the push quiet just in case there is anything that could leak
200+
# sensitive information.
201+
echo -e "\nPushing changes to gh-pages."
202+
git push -fq origin gh-pages 2>&1 >/dev/null
203+
echo -e "\nFinished uploading generated files."
204+
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.9')

.travis.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and are considered the "PyGMT Developers":
1010

1111
* [Wei Ji Leong](https://github.com/weiji14)
1212
* [Tyler Newton](http://www.tnewton.com/)
13+
* [William Schlitzer](https://github.com/willschlitzer)
1314
* [Dongdong Tian](https://seisman.info/)
1415
* [Liam Toney](https://liam.earth/)
1516
* [Leonardo Uieda](http://www.leouieda.com/)

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@ Leave a comment in the PR and we'll help you out.
312312

313313
You can also run tests in just one test script using:
314314

315-
pytest --verbose --mpl --mpl-results-path=results --doctest-modules pygmt/tests/NAME_OF_TEST_FILE.py
315+
pytest pygmt/tests/NAME_OF_TEST_FILE.py
316316

317317
or run tests which contain names that match a specific keyword expression:
318318

319-
pytest --verbose --mpl --mpl-results-path=results --doctest-modules -k KEYWORD pygmt/tests
319+
pytest -k KEYWORD pygmt/tests
320320

321321
### Testing plots
322322

@@ -436,7 +436,7 @@ Some things that will increase the chance that your pull request is accepted qui
436436
[numpy guide](https://numpydoc.readthedocs.io/en/latest/format.html)
437437
for documentation.
438438

439-
Pull requests will automatically have tests run by TravisCI.
439+
Pull requests will automatically have tests run by GitHub Actions.
440440
This includes running both the unit tests as well as code linters.
441441
GitHub will show the status of these checks on the pull request.
442442
Try to get them all passing (green).

MAINTENANCE.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you want to make a contribution to the project, see the
1313
branch. Make a new branch and submit a pull request instead.
1414
* *gh-pages*: Holds the HTML documentation and is served by GitHub. Pages for the master
1515
branch are in the `dev` folder. Pages for each release are in their own folders.
16-
**Automatically updated by TravisCI** so you shouldn't have to make commits here.
16+
**Automatically updated by GitHub Actions** so you shouldn't have to make commits here.
1717

1818

1919
## Reviewing and merging pull requests
@@ -40,7 +40,7 @@ The main advantages of this are:
4040

4141
## Continuous Integration
4242

43-
We use GitHub Actions and TravisCI continuous integration (CI) services to
43+
We use GitHub Actions continuous integration (CI) services to
4444
build and test the project on Linux, macOS and Windows.
4545
They rely on the `requirements.txt` file to install required dependencies using
4646
conda and the `Makefile` to run the tests and checks.
@@ -54,6 +54,12 @@ There are 4 configuration files located in `.github/workflows`:
5454
This is ran on every commit on the *master* and Pull Request branches.
5555
It is also scheduled to run daily on the *master* branch.
5656

57+
On the *master* branch, the workflow also handles the documentation deployment:
58+
59+
* Updating the development documentation by pushing the built HTML pages from the
60+
*master* branch onto the `dev` folder of the *gh-pages* branch.
61+
* Updated the `latest` documentation link to the new release.
62+
5763
2. `ci_tests_dev.yaml` (GMT Latest Tests on Linux/macOS).
5864

5965
This is only triggered when a review is requested or re-requested on a PR.
@@ -72,23 +78,6 @@ Archives will be pushed to TestPyPI on every commit to the *master* branch and
7278
tagged releases, and to PyPI for tagged releases only.
7379

7480

75-
### Travis CI
76-
77-
The configuration file is at `.travis.yml`.
78-
Travis runs tests (Linux only) and handles the documentation deployment automatically:
79-
80-
* Updating the development documentation by pushing the built HTML pages from the
81-
*master* branch onto the `dev` folder of the *gh-pages* branch.
82-
* Updated the `latest` documentation link to the new release.
83-
84-
This way, most day-to-day maintenance operations are automatic.
85-
86-
The scripts that setup the test environment and run the deployments are loaded from the
87-
[fatiando/continuous-integration](https://github.com/fatiando/continuous-integration)
88-
repository to avoid duplicating work across multiple repositories.
89-
If you find any problems with the test setup and deployment, please create issues and
90-
submit pull requests to that repository.
91-
9281
## Continuous Documentation
9382

9483
We use the [Zeit Now for GitHub integration](https://zeit.co/github) to preview changes
@@ -102,7 +91,7 @@ see https://zeit.co/docs/v2/build-step/?query=package.json#defining-a-build-scri
10291
## Making a Release
10392

10493
We try to automate the release process as much as possible.
105-
Travis handles publishing new releases to PyPI and updating the documentation.
94+
GitHub Actions workflow handles publishing new releases to PyPI and updating the documentation.
10695
The version number is set automatically using setuptools_scm based information
10796
obtained from git.
10897
There are a few steps that still must be done manually, though.
@@ -166,7 +155,7 @@ and clicking on publish. A git tag will also be created, make sure that this
166155
tag is a proper version number (following [Semantic Versioning](https://semver.org/))
167156
with a leading `v`. E.g. `v0.2.1`.
168157
169-
Once the release/tag is created, this should trigger Travis to do all the work for us.
158+
Once the release/tag is created, this should trigger GitHub Actions to do all the work for us.
170159
A new source distribution will be uploaded to PyPI, a new folder with the documentation
171160
HTML will be pushed to *gh-pages*, and the `latest` link will be updated to point to
172161
this new folder.

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Build, package, test, and clean
22
PROJECT=pygmt
33
TESTDIR=tmp-test-dir-with-unique-name
4-
PYTEST_ARGS=--cov=$(PROJECT) --cov-config=../pyproject.toml \
4+
PYTEST_COV_ARGS=--cov=$(PROJECT) --cov-config=../pyproject.toml \
55
--cov-report=term-missing --cov-report=xml --cov-report=html \
6-
--doctest-modules -v --mpl --mpl-results-path=results \
76
--pyargs ${PYTEST_EXTRA}
87
BLACK_FILES=$(PROJECT) setup.py doc/conf.py examples
98
BLACKDOC_OPTIONS=--line-length 79
@@ -32,7 +31,7 @@ test:
3231
@echo ""
3332
@cd $(TESTDIR); python -c "import $(PROJECT); $(PROJECT).show_versions()"
3433
@echo ""
35-
cd $(TESTDIR); pytest $(PYTEST_ARGS) $(PROJECT)
34+
cd $(TESTDIR); pytest $(PYTEST_COV_ARGS) $(PROJECT)
3635
cp $(TESTDIR)/coverage.xml .
3736
cp -r $(TESTDIR)/htmlcov .
3837
rm -r $(TESTDIR)

README.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ PyGMT
1010
.. image:: http://img.shields.io/pypi/v/pygmt.svg?style=flat-square
1111
:alt: Latest version on PyPI
1212
:target: https://pypi.python.org/pypi/pygmt
13-
.. image:: http://img.shields.io/travis/GenericMappingTools/pygmt/master.svg?style=flat-square&label=Linux
14-
:alt: Travis CI build status
15-
:target: https://travis-ci.org/GenericMappingTools/pygmt
1613
.. image:: https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg
1714
:alt: GitHub Actions Tests status
1815
:target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3ATests

doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
tutorials/coastlines.rst
3434
tutorials/plot.rst
3535
tutorials/text.rst
36+
tutorials/contour-map.rst
37+
tutorials/earth-relief.rst
3638
tutorials/configuration.rst
3739

3840
.. toctree::

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
- ipython
1515
- matplotlib
1616
- jupyter
17-
- pytest
17+
- pytest>=6.0
1818
- pytest-cov
1919
- pytest-mpl
2020
- coverage[toml]
@@ -23,7 +23,7 @@ dependencies:
2323
- docformatter
2424
- pylint
2525
- flake8
26-
- sphinx=2.2.1
26+
- sphinx
2727
- sphinx_rtd_theme=0.4.3
2828
- sphinx-gallery
2929
- nbsphinx

examples/gallery/plot/scatter3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The :meth:`pygmt.Figure.plot3d` method can be used to plot symbols in 3D.
66
In the example below, we show how the
7-
`Iris flower dataset <https://en.wikipedia.org/wiki/Iris_flower_data_set/>`__
7+
`Iris flower dataset <https://en.wikipedia.org/wiki/Iris_flower_data_set>`__
88
can be visualized using a perspective 3-dimensional plot. The ``region``
99
argument has to include the :math:`x`, :math:`y`, :math:`z` axis limits in the
1010
form of (xmin, xmax, ymin, ymax, zmin, zmax), which can be done automatically

0 commit comments

Comments
 (0)