In this scenario package a only has prereleases, but the specifier used is an exclusive specificier a<0.2.0, the spec says:
The exclusive ordered comparison <V MUST NOT allow a pre-release of the specified version unless the specified version is itself a pre-release. Allowing pre-releases that are earlier than, but not equal to a specific pre-release may be accomplished by using <V.rc1 or similar.
Now, I appreciate there are other parts of the spec that may be contradictory. So I'm not sure if this is an intentional design choice or not? But my understanding is the intent of the spec is it should not be allowed: https://github.com/pypa/packaging/issues/776#issuecomment-1900515985
This is the scenario: https://github.com/astral-sh/packse/blob/0.3.12/scenarios/prereleases.json#L520
In this scenario package a only has prereleases, but the specifier used is an exclusive specificier
a<0.2.0
, the spec says:Now, I appreciate there are other parts of the spec that may be contradictory. So I'm not sure if this is an intentional design choice or not? But my understanding is the intent of the spec is it should not be allowed: https://github.com/pypa/packaging/issues/776#issuecomment-1900515985