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

bug: fixed version incorrectly strips suffix from 0.7b1 #122

Open
valgur opened this issue Dec 30, 2023 · 1 comment
Open

bug: fixed version incorrectly strips suffix from 0.7b1 #122

valgur opened this issue Dec 30, 2023 · 1 comment

Comments

@valgur
Copy link

valgur commented Dec 30, 2023

Hi @qchateau and thank you for creating this incredibly useful tool.

It looks like the _fix_version() function has an edge case that is not being handled correctly:
a 0.7b1 release gets incorrectly transformed into 0.7.

I unfortunately did not catch that when merging that version into CCI, leading to conan-io/conan-center-index#22071.

I traced the issue down to this regex replacement:

VERSION_RE = re.compile(r"[0-9]+(\.[0-9]+)+")

match = VERSION_RE.search(version)
if match:
return match.group(0)

I would gladly submit a PR as well, but it's not entirely clear what cases the function is meant to cover. A small test suite would be beneficial here. I suppose I could create one from the large pool of version numbers already being handled by the tool.

@valgur
Copy link
Author

valgur commented Dec 30, 2023

Also, I also scanned all existing version-URL pairs in CCI and this was the only instance of this error that turned up, fortunately.

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

No branches or pull requests

1 participant