Skip to content

FIX: Improved handling of refname edge cases#229

Merged
effigies merged 2 commits intopython-versioneer:masterfrom
effigies:nibabel_fixes
Dec 6, 2020
Merged

FIX: Improved handling of refname edge cases#229
effigies merged 2 commits intopython-versioneer:masterfrom
effigies:nibabel_fixes

Conversation

@effigies
Copy link
Copy Markdown
Contributor

This PR covers two edge cases.

The first is a case where the keywords passed to git_versions_from_keywords() is non-empty but refnames is missing. IIRC this could occur in git archives for hashes that had no branches or tags associated. This breaks L54:

refnames = keywords["refnames"].strip()

Instead we reduce the check to 'refnames' in keywords, which covers the actually erroring case, and provide a better error message.

The second is a case where you might have a tag test_tag. If you have a tag prefix 'v', this will get filtered out. If your tag prefix is '', then all weird tags get pulled in. So I've added a filter that requires the first character of the tag (post-prefix) to be a digit.

This is an edge case that can be hit if using git-archive on a release
with no refnames.
@effigies
Copy link
Copy Markdown
Contributor Author

effigies commented Dec 5, 2020

Anybody care to review?

@effigies
Copy link
Copy Markdown
Contributor Author

effigies commented Dec 6, 2020

This does resolve concrete issues for me, and hasn't spawned outrage. I'll go ahead and merge...

@effigies effigies merged commit d2f04db into python-versioneer:master Dec 6, 2020
@effigies effigies deleted the nibabel_fixes branch December 6, 2020 14:03
@effigies effigies added this to the 0.20 milestone May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant