Skip to content
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

Add a fallback option to output the latest tag #1834

Merged
merged 1 commit into from Mar 30, 2022
Merged

Conversation

dhwthompson
Copy link
Contributor

This is available either by running tag-release current or just tag-release with no arguments. I realized I wanted some way to ask "hey, where are we at right now?", and figured that this was a reasonable way to do it. It also seems more approachable than spitting out an error when no arguments are provided, which feels like a useful property to have in a potentially dangerous script.

@@ -230,8 +230,10 @@ def _build_parser():

parser.add_argument(
"action",
choices=["promote", "bump", "minor", "patch"],
help="the type of release to tag",
nargs="?",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is available either by running `tag-release current` or just
`tag-release` with no arguments. I realized I wanted some way to ask
"hey, where are we at right now?", and figured that this was a
reasonable way to do it. It also seems more approachable than spitting
out an error when no arguments are provided, which feels like a useful
property to have in a potentially dangerous script.
@dhwthompson
Copy link
Contributor Author

Example output:

$ ./tools/tag-release
Most recent tag: v0.7.0-rc5
Run with the `--help` flag for a list of available commands.

Copy link
Contributor

@SamLR SamLR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable.

I did spot, though, that this requires python3.8 (for the walrus operator :=) while the default python version on mac is 3.7 I'm not sure if this needs to downgrade? Apaprently the version of python3 that ubuntu ships seems to be 3.8.1

@dhwthompson
Copy link
Contributor Author

I did spot, though, that this requires python3.8 (for the walrus operator :=) while the default python version on mac is 3.7

That’s a good thought, although I don’t seem to be seeing quite the same picture of macOS Python versioning as you. I couldn’t find any official documentation, but from a bit of Stack Overflow spelunking and checking on my own machine, it looks like the last few versions have been:

OS version Name Python version
10.15 Catalina 3.7.3
11 Big Sur 3.8.2
12 Monterey 3.8.9

I don’t know what distribution of macOS versions our Mac-based developers have, but it seems worth the small amount of effort it would take to de-walrus-ify the code, just in case. I’ll make a follow-up PR.

@dhwthompson dhwthompson merged commit 420d971 into main Mar 30, 2022
@dhwthompson dhwthompson deleted the tag-nothing branch March 30, 2022 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants