From 7123f222fffd7e8d3d40041bb10e006a93e05c6d Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:45:43 -0400 Subject: [PATCH 01/10] Remove vercel configuration files --- package.json | 8 -------- vercel.json | 6 ------ 2 files changed, 14 deletions(-) delete mode 100644 package.json delete mode 100644 vercel.json diff --git a/package.json b/package.json deleted file mode 100644 index bb5240d713e..00000000000 --- a/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "scripts": { - "build:miniconda": "curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash ~/miniconda.sh -b -p $HOME/miniconda", - "build:pygmt": "conda install mamba -c conda-forge -y && mamba env create -f environment.yml && source activate pygmt && pip install --no-deps .", - "build:docs": "source activate pygmt && cd doc && make all && mv _build/html ../public", - "build": "export PATH=$HOME/miniconda/bin:$PATH && npm run build:miniconda && npm run build:pygmt && npm run build:docs" - } -} diff --git a/vercel.json b/vercel.json deleted file mode 100644 index af488297cc5..00000000000 --- a/vercel.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "github": { - "silent": true - }, - "public": true -} From 5b7a43cf24b278c4c9d1cd61a2aa876b2d21159c Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:56:01 -0400 Subject: [PATCH 02/10] Setup readthedocs configuration file Docs build uses mamba to install dependencies from environment.yml. See also https://docs.readthedocs.io/en/stable/config-file/v2.html and https://docs.readthedocs.io/en/stable/guides/conda.html --- .readthedocs.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000000..94782cd898f --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,23 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: "mambaforge-4.10" + +# Build documentation in the doc/ directory with Sphinx +sphinx: + configuration: doc/conf.py + +# If using Sphinx, optionally build your docs in additional formats such as PDF +# formats: +# - pdf + +# Optionally declare the Python requirements required to build your docs +conda: + environment: environment.yml From d8d3609cafa98c20e171c170bdac5619606c8fed Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Sun, 3 Apr 2022 12:18:02 -0400 Subject: [PATCH 03/10] Run pip install . in the readthedocs build environment To fix `ModuleNotFoundError: No module named 'pygmt'`. --- .readthedocs.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 94782cd898f..cb3c940e80c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -21,3 +21,7 @@ sphinx: # Optionally declare the Python requirements required to build your docs conda: environment: environment.yml +python: + install: + - method: pip + path: . From 2423151f0c2cfd50c9e4505003d28cdc5df21d3e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 15 Jun 2022 12:35:38 +0800 Subject: [PATCH 04/10] Remove vercel configurations and add readthedocs configurations in MANIFEST.in --- MANIFEST.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 02d53b2e67a..88021545575 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,10 +4,9 @@ prune doc* prune examples* exclude .dvcignore exclude .gitignore +exclude .readthedocs.yaml exclude AUTHORSHIP.md exclude CONTRIBUTING.md exclude Makefile exclude environment.yml -exclude package.json exclude requirements.txt -exclude vercel.json From afe391043599f56a6807983d644ca2889089ccff Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 15 Jun 2022 12:41:43 +0800 Subject: [PATCH 05/10] Update doc/maintenance.md to trigger builds in PR --- doc/maintenance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/maintenance.md b/doc/maintenance.md index c866ba9349c..09afb0e4216 100644 --- a/doc/maintenance.md +++ b/doc/maintenance.md @@ -151,7 +151,7 @@ There are 11 configuration files located in `.github/workflows`: ## Continuous Documentation -We use the [Vercel for GitHub](https://github.com/apps/vercel) App to preview changes +We use the [ReadtheDocs](https://readthedocs.org/) service to preview changes made to our documentation website every time we make a commit in a pull request. The service has a configuration file `vercel.json`, with a list of options to change the default behaviour at https://vercel.com/docs/configuration. From 55a85e2db8bb4ff317c6054de5b277be04180e07 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 15 Jun 2022 13:14:16 +0800 Subject: [PATCH 06/10] Set canonical URL by setting html_baseurl --- doc/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/conf.py b/doc/conf.py index fc5cefa6f92..f1175a706ad 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -142,6 +142,7 @@ .. |year| replace:: {year} """ +html_baseurl = "https://pygmt.org/latest/" html_last_updated_fmt = "%b %d, %Y" html_title = "PyGMT" html_short_title = "PyGMT" From 28aa23f9407ec5814bfebf224c551c407f84c1e5 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 15 Jun 2022 13:36:34 +0800 Subject: [PATCH 07/10] Update contributing and maintenance guides --- doc/contributing.md | 4 ++-- doc/maintenance.md | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/contributing.md b/doc/contributing.md index 339cf325e56..7f3a2787031 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -289,8 +289,8 @@ download and install anything: click on the "Propose changes" button to open a pull request. 7. The pull request will run the GMT automated tests and make a preview deployment. You can see how your change looks in the PyGMT documentation by clicking the - "View deployment" button after the Vercel bot has finished (usually 5-10 minutes - after the pull request was created). + "Details" button of the "docs/readthedocs.org:pygmt-dev" status check, + after the building has finished (usually 10-15 minutes after the pull request was created). 8. We'll review your pull request, recommend changes if necessary, and then merge them in if everything is OK. 9. Done! diff --git a/doc/maintenance.md b/doc/maintenance.md index 09afb0e4216..0a36d4bfbf0 100644 --- a/doc/maintenance.md +++ b/doc/maintenance.md @@ -153,11 +153,8 @@ There are 11 configuration files located in `.github/workflows`: We use the [ReadtheDocs](https://readthedocs.org/) service to preview changes made to our documentation website every time we make a commit in a pull request. -The service has a configuration file `vercel.json`, with a list of options to -change the default behaviour at https://vercel.com/docs/configuration. -The actual script `package.json` is used by Vercel to install the necessary packages, -build the documentation, copy the files to a 'public' folder and deploy that to the web, -see https://vercel.com/docs/build-step. +The service has a configuration file `.readthedocs.yaml`, with a list of options +to change the default behaviour at https://docs.readthedocs.io/en/stable/config-file/index.html. ## Dependencies Policy From 8e44ed70223acb5a44459c3ee20126ac44884e55 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 15 Jun 2022 15:46:44 +0800 Subject: [PATCH 08/10] Customize the pre_build step to generate API stub files --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index cb3c940e80c..ef0c7c43f3f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,6 +9,9 @@ build: os: ubuntu-20.04 tools: python: "mambaforge-4.10" + jobs: + pre_build: # Generate api stub files before building + - make -C doc api # Build documentation in the doc/ directory with Sphinx sphinx: From d21acf9519c2b34fd2ad569014a86f0cb39a4c9a Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 23 Jun 2022 09:31:59 +0800 Subject: [PATCH 09/10] Only install packages required for building docs --- .github/workflows/docs_environment.yml | 26 ++++++++++++++++++++++++++ .readthedocs.yaml | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs_environment.yml diff --git a/.github/workflows/docs_environment.yml b/.github/workflows/docs_environment.yml new file mode 100644 index 00000000000..9014c949180 --- /dev/null +++ b/.github/workflows/docs_environment.yml @@ -0,0 +1,26 @@ +name: pygmt +channels: + - conda-forge + - defaults +dependencies: + # Required dependencies + - pip + - gmt=6.3.0 + - numpy>=1.19 + - pandas + - xarray + - netCDF4 + - packaging + # Optional dependencies + - geopandas + # Development dependencies (general) + - build + - ipython + - make + # Dev dependencies (building documentation) + - myst-parser + - sphinx + - sphinx-copybutton + - sphinx-design + - sphinx-gallery + - sphinx_rtd_theme diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ef0c7c43f3f..168af1adc24 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -23,7 +23,7 @@ sphinx: # Optionally declare the Python requirements required to build your docs conda: - environment: environment.yml + environment: .github/workflows/docs_environment.yml python: install: - method: pip From 96e7aac5e376070bfadfd4ccb349ee48d31fdfef Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 7 Jul 2022 13:46:53 +0800 Subject: [PATCH 10/10] Move the docs environment file to the ci directory --- .readthedocs.yaml | 2 +- MANIFEST.in | 1 + .../workflows/docs_environment.yml => ci/requirements/docs.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename .github/workflows/docs_environment.yml => ci/requirements/docs.yml (96%) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 168af1adc24..800667cb006 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -23,7 +23,7 @@ sphinx: # Optionally declare the Python requirements required to build your docs conda: - environment: .github/workflows/docs_environment.yml + environment: ci/requirements/docs.yml python: install: - method: pip diff --git a/MANIFEST.in b/MANIFEST.in index 88021545575..74e72ad15f5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ prune .dvc prune .github* +prune ci prune doc* prune examples* exclude .dvcignore diff --git a/.github/workflows/docs_environment.yml b/ci/requirements/docs.yml similarity index 96% rename from .github/workflows/docs_environment.yml rename to ci/requirements/docs.yml index 9014c949180..20b52eb0675 100644 --- a/.github/workflows/docs_environment.yml +++ b/ci/requirements/docs.yml @@ -6,7 +6,7 @@ dependencies: # Required dependencies - pip - gmt=6.3.0 - - numpy>=1.19 + - numpy>=1.20 - pandas - xarray - netCDF4