-
Notifications
You must be signed in to change notification settings - Fork 251
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
Unreasonable comparisons #320
Comments
A practical example:
As much as I wrap head my around this, i would expect both 20.1.1 and 20.1 to satisfy the requirement. |
It's not very clear from the PEP, but prefix matching (using See also these portions of the source: packaging/packaging/specifiers.py Lines 392 to 395 in 59e1488
packaging/tests/test_specifiers.py Lines 65 to 70 in db291c7
|
I think the problem is that prefix matching on ordered comparisons aren't defined, but they are supported as best I can tell. Miro posted an example of their use, above. If I create a mostly-empty module whose setup.py includes this line:
then:
|
It's "supported" but only by parsing it as a
|
Closing this. Legacy specifiers will be deprecated in the next release and this will emit a warning. |
Hi,
we have found that
packaging
evaluates some comparisons unreasonably / illogically.I'll use this format:
For these comparisons,
packaging
ignores equality and evaluates as if the operator was simply<
:And in this set, also the
>
operator is evaluated wrong:Both these comparisons are undefined according to PEP 440. However, as someone will surely be using them, tests have been added for them in the Python-to-RPM-version project
pyreq2rpm
, see PR gordonmessmer/pyreq2rpm#7.The tests currently verify that the comparisons are consistent with this illlogical upstream behaviour. But of course, an even better solution would be to fix the behaviour.
The text was updated successfully, but these errors were encountered: