Conversation
Contributor
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.
Comment on lines
180
to
182
| # 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"): |
Comment on lines
19
to
23
| # 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 "" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.