diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000000..800667cb006 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,30 @@ +# 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" + jobs: + pre_build: # Generate api stub files before building + - make -C doc api + +# 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: ci/requirements/docs.yml +python: + install: + - method: pip + path: . diff --git a/MANIFEST.in b/MANIFEST.in index 02d53b2e67a..74e72ad15f5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,13 +1,13 @@ prune .dvc prune .github* +prune ci 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 diff --git a/ci/requirements/docs.yml b/ci/requirements/docs.yml new file mode 100644 index 00000000000..20b52eb0675 --- /dev/null +++ b/ci/requirements/docs.yml @@ -0,0 +1,26 @@ +name: pygmt +channels: + - conda-forge + - defaults +dependencies: + # Required dependencies + - pip + - gmt=6.3.0 + - numpy>=1.20 + - 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/doc/conf.py b/doc/conf.py index eda5625a5e4..9a8e424fab6 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" diff --git a/doc/contributing.md b/doc/contributing.md index 3d1cbcaa7ed..96cdcb65516 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 75cd780185c..f4202a16b96 100644 --- a/doc/maintenance.md +++ b/doc/maintenance.md @@ -151,13 +151,10 @@ 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. -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 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 -}