fix: resolve invalid project version selection#178
Merged
Merged
Conversation
Signed-off-by: Ilona Shishov <ishishov@ishishov-thinkpadp1gen7.raanaii.csb>
zvigrinberg
approved these changes
Jan 4, 2026
zvigrinberg
left a comment
Collaborator
There was a problem hiding this comment.
@IlonaShishov This look great.
Thanks!
LGMT Approved.
heatherzh01
pushed a commit
that referenced
this pull request
Mar 6, 2026
fix: resolve invalid project version selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause:
The project uses setuptools_scm for dynamic versioning, which determines the package version by running git describe to find the closest git tag.
Besides release tags, the repository contains CI-generated tags from Tekton pipelines with the format pr-{PR_NUMBER}-{COMMIT_HASH} (e.g., pr-162-4c9bb19). These tags are used to track successful PR builds but do not follow PEP 440 versioning standards.
Since git describe returns the closest tag by commit distance, it would find tags like pr-162-4c9bb19 before reaching the valid version tag v0.0.1. When setuptools_scm attempted to parse the commit hash portion (4c9bb19) as a version number, it failed.
Solution
Added a custom git_describe_command in pyproject.toml that instructs setuptools_scm to only match tags starting with v*:
[tool.setuptools_scm]git_describe_command = ["git", "describe", "--tags", "--match", "v*"]
This uses git's --match pattern to filter out the PR tags and only consider valid semantic version tags (e.g., v0.0.1, v1.2.3), allowing setuptools_scm to correctly derive the package version.
RESOLVED JIRA ISSUE: https://issues.redhat.com/browse/APPENG-4244