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 in version comparison #493

Open
joders opened this issue Dec 30, 2024 · 1 comment
Open

Bug in version comparison #493

joders opened this issue Dec 30, 2024 · 1 comment

Comments

@joders
Copy link

joders commented Dec 30, 2024

The code uses a string comparison for the version strings latest_version > current_version which yields undesired behavior. Imagine the version numbers 1.2 and 1.15:

1.15 is a higher version than 1.2 but

the comparison will consider 1.2 higher.

To repair this we can change the code

latest_version > current_version

to

[int(i) for i in latest_version.split('.')] > [int(i) for i in current_version.split('.')]

@jay0lee
Copy link
Member

jay0lee commented Jan 1, 2025

1.15 is a higher version than 1.2 but

that's not historically true for GYB. GYB versions have always been valid numbers and 1.2 is a larger number than 1.15.

Having said that,

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

2 participants