-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Tell setuptools_scm to ignore non-version tags #3193
Conversation
@@ -150,6 +150,16 @@ include-package-data = true | |||
where = ["src"] | |||
|
|||
[tool.setuptools_scm] | |||
tag_regex = "^v(?P<version>20\\d{2}\\.\\d{1,2}\\.\\d{1,2})$" |
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.
This tells setuptools_scm
how to extract the "version" string.
- Require 4 digit year
- Allows 1 or 2 digit month and day strings (since PyPI and some other tools seem to default to 1 digit rather than allowing a leading zero)
git_describe_command = [ | ||
"git", | ||
"describe", | ||
"--dirty", | ||
"--tags", | ||
"--long", | ||
"--match", | ||
"v20*", | ||
] |
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.
This changes the command which is used by setuptools_scm
to gather information from git
about the tags and current state of the repository. By using the v20*
glob, it will only search for tags which match our current versioning scheme.
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 can deal with the eventual failure in 77 years :)
markers = [ | ||
"slow: marks tests as slow (deselect with '-m \"not slow\"')", | ||
] | ||
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"] |
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.
Not sure why this is all in red. Just a change in line-wrapping from my autoformatter.
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.
Not sure either but it's very scary.
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.
Aha! Nice work.
git_describe_command = [ | ||
"git", | ||
"describe", | ||
"--dirty", | ||
"--tags", | ||
"--long", | ||
"--match", | ||
"v20*", | ||
] |
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 can deal with the eventual failure in 77 years :)
markers = [ | ||
"slow: marks tests as slow (deselect with '-m \"not slow\"')", | ||
] | ||
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"] |
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.
Not sure either but it's very scary.
Overview
Update configuration for
setuptools_scm
such that it only considers tags matchingv20*
when trying to determine the current version.Related to #3140
Testing
After altering
pyproject.toml
I attempted to install the PUDL package usingpip
To-do list