-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(tools): Python script for automatically applying version (#6012) #6080
Conversation
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.
description='Apply the specified version to affected source files') | ||
parser.add_argument('version', metavar='version', type=str, | ||
help='The version to apply') | ||
|
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.
Please add a help
too with usage example(s).
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.
added
scripts/update_version.py
Outdated
|
||
|
||
class Version: | ||
RE_PATTERN = r"(\d+)\.(\d+)\.(\d+)(-dev)?" |
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.
Do not limit it to -dev
.
RE_PATTERN = r"(\d+)\.(\d+)\.(\d+)(-dev)?" | |
RE_PATTERN = r"(\d+)\.(\d+)\.(\d+)(-a-zA-Z0-9)?" |
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.
updated
4cb67f3
to
9ec684c
Compare
Great, thank you! I hope #5865 will be merged soon. |
6a61911
to
35b0475
Compare
Updated |
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've tested it and it works very well! Thank you!
Does it need to be cherry-picked to other release branches? |
I think no for now. |
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'm not familiar with regular expression. Please give it a full test.
How can we test such a script? |
35b0475
to
6f13cc2
Compare
It was tested manually for several version variants. I'd go with that, writing test cases for such a small script feels extensive. |
Not all questions are clear about updating version numbers but I merge it now to make some order. Probably a follow up PR will be required. |
Fixes #6012