Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates PyGMT to follow Semantic Versioning more strictly by removing the leading v from pygmt.__version__, and aligns various deprecation markers, warnings, comments, and maintenance documentation with the X.Y.Z version format.
Changes:
- Change
pygmt.__version__to returnX.Y.Z(no leadingv) viaimportlib.metadata.version. - Update deprecation directives/decorator arguments and warning/error message text to use
X.Y.Z. - Adjust maintainer/release documentation and checklist to reflect the new version-string convention.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pygmt/_show_versions.py |
Removes v prefix from __version__ and updates Ghostscript/GMT warning strings. |
pygmt/helpers/decorators.py |
Updates version strings in comments/errors and in deprecate_parameter doc examples. |
pygmt/src/basemap.py |
Updates deprecation notes and warning message to use 0.19.0 format. |
pygmt/src/coast.py |
Updates deprecation directive version formatting and reflows text. |
pygmt/src/subplot.py |
Updates deprecated directive and deprecate_parameter decorator version args. |
pygmt/src/grdsample.py |
Updates deprecate_parameter decorator version args. |
pygmt/clib/session.py |
Updates version references in comments to drop leading v. |
pygmt/figure.py |
Updates a comment that references a dependency version string. |
pygmt/datasets/tile_map.py |
Minor comment tweak; still uses pygmt.__version__ for User-Agent construction. |
pygmt/tests/test_timestamp.py |
Updates docstring text referencing the removal version. |
doc/maintenance.md |
Updates semantic-versioning wording and deprecation example versions. |
.github/ISSUE_TEMPLATE/4-release_checklist.md |
Updates release checklist guidance for version strings (including Zenodo version field). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # TODO(contextily>=1.7.0): Remove once contextily>=1.7.0 is required. | ||
| # The 'headers' parameter was added in contextily v1.7.0 | ||
| # The 'headers' parameter was added in contextily 1.7.0. | ||
| if Version(contextily.__version__) < Version("1.7.0"): |
| # Get semantic version through setuptools-scm | ||
| __version__ = f"v{version('pygmt')}" # e.g. v0.1.2.dev3+g0ab3cd78 | ||
| __version__ = version("pygmt") # e.g., 0.1.2.dev3+g0ab3cd78 | ||
| __commit__ = ( # 0ab3cd78 | ||
| __version__.rsplit(sep="+g", maxsplit=1)[-1] if "+g" in __version__ else "" | ||
| ) |
There was a problem hiding this comment.
Wondering if we should update the table for the Minimum Supported Version (https://pygmt-dev--4838.org.readthedocs.build/en/4838/minversions.html), even we are linking to the GitHub tags, where we still use the "v".
Edit: See first comment of PR why this was not changed.
There was a problem hiding this comment.
Do the changes in this PR affect the URL to the PyGMT website? Currently we use the "v" there, e.g., https://www.pygmt.org/v0.19.0/index.html. If we remove the "v", the old version specific URLs will not resolve anymore.
Edit: Not changed, see first comment of this PR.
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
It's not that difficult as I initially thought. See changes in 52d49f7. Edit: Actually, changes in 52d49f7 works well for |
Previously,
pygmt.__version__was in the format ofvX.Y.Z. This PR removes the leadingv, thus, the version is in the format ofX.Y.Z.It should has minor effects on users, as
packaging.version.Versioncan handle leadingvproperly:Addresses #4790
I used
ack 'v[0-9]*\.[0-9]*\.[0-9]*'to ensure are related cases are fixed, except:doc/_static/version_switch.js:'v0.19.0': 'v0.19.0'. The first one controls the URL, while the 2nd one controls the text string shown in the version switcher. We can't update the first one, because it will break many existing references to the PyGMT documentation. I think it's better to keep these two consistent. So, none of them are changed.doc/minversions.md: The first column showsv0.19.0. It's technically difficult to change it to0.19.0, because it's linked to thev0.19.0tag.Preview: https://pygmt-dev--4838.org.readthedocs.build/en/4838/index.html