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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor Version logic from packaging #183

Closed
wants to merge 2 commits into from
Closed

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented May 15, 2024

No description provided.

Copy link

cloudflare-pages bot commented May 15, 2024

Deploying logfire-docs with 聽Cloudflare Pages 聽Cloudflare Pages

Latest commit: ea181d0
Status:馃毇聽 Build failed.

View logs

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 51.26904% with 96 lines in your changes are missing coverage. Please review.

Files Patch % Lines
logfire/_vendor/packaging/version.py 49.38% 72 Missing and 10 partials 鈿狅笍
logfire/_vendor/packaging/_structures.py 56.25% 14 Missing 鈿狅笍

馃摙 Thoughts on this report? Let us know!

@alexmojaki
Copy link
Contributor

I don't feel good about this. If we don't want to rely on other packages for version parsing then I'd rather find a different solution. For example:

version = '2.5.3'
parts = tuple(map(int, version.split('.')[:2]))
print(parts < (2, 6))
print(parts < (2, 5))

Parsing a full version requires accounting for betas and stuff (which might be easy enough for known packages like pydantic) but in this case we don't even need the full version, just the first two parts.

@Kludex Kludex closed this May 23, 2024
@Kludex Kludex deleted the vendor-packaging-version branch May 23, 2024 08:03
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.

None yet

2 participants