astral-sh / packse

Python packaging scenarios
Apache License 2.0
93 stars 9 forks source link

Add scenarios based on legacy versions and legacy specifiers #168

Open notatallshaw opened 4 months ago

notatallshaw commented 4 months ago

I'm willing to write these scenarios myself, but I'm making an issue first in case of any objection, in particular because this is about following the spec, and I beleive uv deviates from the spec for this behavior to be more compatible with the ecosystem:

  1. With requirement A and A has a new version with a non-legacy version and an old version with a legacy version then A should successfully resolve to the new non-legacy version
  2. With requirement A and A has a new version with a legacy version and an old version with a non-legacy version then A should successfully resolve to old non-legacy version
  3. With requirement A and A only has legacy versions then A should not resolve
  4. With a requirement on A that involves a legacy version in the specifier then that requirement should not resolve
  5. Same as all of above but the where A depends on B and B suffers from the legacy versions/specifiers
konstin commented 4 months ago

Note that in uv, we have lenient requirement and lenient version types with a hardcoded set of fixups and we don't make a different and we currently don't track whether the fixups were used or not, while errors outside of these are already skipped.

notatallshaw commented 4 months ago

Yeah, if my understanding is correct, both pip and uv are not following the spec.

It seems like the correct things to do it's make a scenario that follows the spec and it can be set to expect fail where it has to.

zanieb commented 4 months ago

Sounds good to me! Although I'm not sure what we should do with the outcomes considering that pip and uv both support lenient parsing. Perhaps we can have a strict parse mode that we enable for these particular scenarios.

notatallshaw commented 4 months ago

pip is very likely to stop accepting legacy versions and specifiers on the next release.