From bae080c037a3fb0c768ee1a48cd44a6b684ce12a Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 9 Apr 2023 13:52:57 +0800 Subject: [PATCH 1/2] doc: Use substitutions to show the minimum required Python and GMT versions dynamically --- doc/conf.py | 8 ++++++++ doc/install.rst | 11 ++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 6c356c0fe2e..6edaf9e6f58 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -5,12 +5,14 @@ # pylint: disable=invalid-name import datetime +from importlib.metadata import metadata # isort: off from sphinx_gallery.sorting import ( # pylint: disable=no-name-in-module ExplicitOrder, ExampleTitleSortKey, ) +import pygmt from pygmt import __commit__, __version__ from pygmt.sphinx_gallery import PyGMTScraper @@ -149,9 +151,15 @@ html_baseurl = "https://pygmt.org/latest/" release = __version__ +requires_python = metadata("pygmt")["Requires-Python"] +with pygmt.clib.Session() as lib: + requires_gmt = ">=" + lib.required_version + # These enable substitutions using |variable| in the rst files rst_epilog = f""" .. |year| replace:: {year} +.. |requires_python| replace:: {requires_python} +.. |requires_gmt| replace:: {requires_gmt} """ html_last_updated_fmt = "%b %d, %Y" diff --git a/doc/install.rst b/doc/install.rst index 834fb168ae3..86fbff07af8 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -64,7 +64,7 @@ Start by looking at the tutorials on our sidebar, good luck! Which Python? ------------- -PyGMT is tested to run on **Python 3.8 or greater**. +PyGMT is tested to run on Python |requires_python|. We recommend using the `Mambaforge `__ Python distribution to ensure you have all dependencies installed and the @@ -77,12 +77,9 @@ installations on your system. Which GMT? ---------- -PyGMT requires Generic Mapping Tools (GMT) version 6 as a minimum, which is the -latest released version that can be found at -the `GMT official site `__. -We need the latest GMT (>=6.3.0) since there are many changes being made to GMT -itself in response to the development of PyGMT, mainly the new -:gmt-docs:`modern execution mode `. +PyGMT requires Generic Mapping Tools (GMT) |requires_gmt| since there +are many changes being made to GMT itself in response to the development of PyGMT, +mainly the new :gmt-docs:`modern execution mode `. Compiled conda packages of GMT for Linux, macOS and Windows are provided through `conda-forge `__. From f0ea54b7b1a9ecf83b19108c47ea9e8dbde34ea2 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 17 Apr 2023 15:01:08 +0800 Subject: [PATCH 2/2] No need to update doc/install.rst after bumping the minimum required GMT version --- .github/ISSUE_TEMPLATE/bump_gmt_checklist.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bump_gmt_checklist.md b/.github/ISSUE_TEMPLATE/bump_gmt_checklist.md index 5387e91eeba..4f4d652b080 100644 --- a/.github/ISSUE_TEMPLATE/bump_gmt_checklist.md +++ b/.github/ISSUE_TEMPLATE/bump_gmt_checklist.md @@ -28,7 +28,6 @@ assignees: '' **To-Do for bumping the minimum required GMT version**: - [ ] Bump the minimum required GMT version (1 PR) - - [ ] Update `doc/install.rst` - [ ] Update `required_version` in `pygmt/clib/session.py` - [ ] Update `test_get_default` in `pygmt/tests/test_clib.py` - [ ] Update compatibility table in `README.rst`