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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

git_describe_command = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--match",
"v20*",
]
Comment on lines +154 to +162
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 :)


[tool.ruff]
select = [
Expand Down Expand Up @@ -263,9 +273,7 @@ filterwarnings = [
"once:The behavior of DataFrame concatenation with empty or all-NA entries is deprecated.:FutureWarning",
]

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.

# Oddly, despite the use of --cov-config=pyproject.toml here, pytest does not seem to
# pick up the source directories specified in the [tool.coverage.run] section below.
# (though it *does* pick up the omit parameters!). This means we need to specify the
Expand Down