-
Notifications
You must be signed in to change notification settings - Fork 235
Set __commit__ to an empty string for non-dev releases #1174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/format |
doc/conf.py
Outdated
| f'<a href="{repository_url}/commit/{ __commit__ }">{ __commit__[:8] }</a>' | ||
| ) | ||
| else: | ||
| commit_link = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have this if-else block, could we be smart and point to the tag on GitHub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to detect whether the commit string is a hash like a1b2c4d4 or a version tag like v0.X.Y, but the idea is to have something like so (note, don't commit yet as it won't work):
| commit_link = "" | |
| commit_link = f'<a href="{repository_url}/tree/{ __commit__ }">{ __commit__}</a>' |
which would e.g. point to https://github.com/GenericMappingTools/pygmt/tree/v0.3.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about it too. It's OK to point to the specific tag, but the text would be "Revision v0.3.1", not "Release v0.3.1".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Revision v0.3.1" doesn't sound too bad actually (though it's not perfect either).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be backported to the gh-pages branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps do the backport together with #1151, as mentioned in #1150 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sounds like a good plan.
…gTools#1174) * Set __commit__ to an empty string for non-dev releases * Link to tags for non-dev releases Co-authored-by: actions-bot <[email protected]>

Description of proposed changes
For non-dev versions,
__version__is a string likev0.3.1, without commit hashes. In this case, we should set__commit__to"".When
__commit__is empty, the "Revision xxx" in the documentation footer won't show, so this PR also fixes #1171.Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version