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

Tell setuptools_scm to ignore non-version tags #3193

Merged
merged 2 commits into from
Dec 27, 2023
Merged

Conversation

zaneselvans
Copy link
Member

Overview

Update configuration for setuptools_scm such that it only considers tags matching v20* when trying to determine the current version.

Related to #3140

Testing

After altering pyproject.toml I attempted to install the PUDL package using pip

To-do list

@@ -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})$"
Copy link
Member Author

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)

Comment on lines +154 to +162
git_describe_command = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--match",
"v20*",
]
Copy link
Member Author

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.

Copy link
Member

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\"')"]
Copy link
Member Author

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.

Copy link
Member

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.

@zaneselvans zaneselvans added the release Tasks directly related to data and software releases. label Dec 27, 2023
Copy link
Member

@jdangerx jdangerx left a comment

Choose a reason for hiding this comment

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

Aha! Nice work.

Comment on lines +154 to +162
git_describe_command = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--match",
"v20*",
]
Copy link
Member

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\"')"]
Copy link
Member

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.

@zaneselvans zaneselvans merged commit 839615e into dev Dec 27, 2023
13 checks passed
@zaneselvans zaneselvans deleted the fix-scm-versions branch December 27, 2023 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Tasks directly related to data and software releases.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants