-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: _compare_version backward incompat #10404
Comments
I believe there were some relatively recent changes by @cbrnr if I'm not mistaken (cannot check right now), could you have a look at the history of that function and see if this problem maybe only started showing up after these changes? |
This is a bit unfortunate and maybe even a bug? They are explicitly recommending to switch to |
I have to say that IMHO the new behavior is more correct than the old one though. 1.0 is newer than 1.0dev0. So the version comparison should be |
Technically yes, |
As @hoechenberger suspected this is expected behavior, and |
Let's change our code to make it more consistent with my thinking 😅🥴😁 |
I'd rather add a loose=True that prunes the dev. Most of the time if a person is using 1.0.dev0, they probably have what's needed and if they don't they know how to update. Plus it's backward compatible this way. And it's much easier than changing 100+ places we use (and think about) these comparisons. |
So this would basically affect equality comparisons, right? Using |
I can document this inaccuracy with |
Even if documented just stripping the >>> LooseVersion("1.0.dev0") >= LooseVersion("1.0")
True
>>> LooseVersion("1.0.dev0") <= LooseVersion("1.0")
False
>>> LooseVersion("1.0.dev0") == LooseVersion("1.0")
False So the difference is that a |
The most important thing is that it restores the behavior of Line 100 in 6608b72
So for example:
So I think it should work. So maybe we should add |
This sounds good! |
cc @hoechenberger:
This is a problem because we usually want the second result :(
The
git grep check_version | wc -l
count is 67 andgit grep _compare_version | wc -l
is 26, I'd rather not have to change all of these to allow for.dev0
extensions. Plus other submodules likemne-nirs
that already use this (where I saw the problem actually!) will not work properly...I'm tempted to change this to cut off any
.dev
from the end to make life easy, but then we depart from standard. But it seems a bit like the lesser of two evils here.The text was updated successfully, but these errors were encountered: