Closed huonw closed 2 months ago
Seems solidly buggy to me. Thanks for the repro case.
Pex already has Pip runtime patching technology it deploys to get around this sort of error in other code paths. That patching is almost certainly not being applied here in the downloader code.
FYI: I'll not be back to a keyboard to work on this or review fixes until 4/19.
Ok, the runtime patching was happening, it was just happening against incomplete information. Fix coming today.
When trying to build a PEX with a requirement that restricts Python interpreter versions (e.g. >= 3.10), it seems one can get seemingly-spurious
requires different Python
errors if all of these conditions are true:--complete-platforms
is being used to build for a different platform (which does satisfy the Python interpreter requirement)PEX_ROOT
has not had a PEX execution using compatible Python version manipulate that dependencies (this is a bit fuzzy, I'm not sure of the details)--lock
is being used to pin versions(The first two are, I believe, the normal way to do a cross-build for a "foreign" platform, and so are just "table stakes". The last two are more interesting.)
In particular, with appropriate complete platform and lock files:
Fails with:
https://gist.github.com/huonw/456ed93d53c992894cacb4efe71250fe has a full reproducer, including the full output of the failure above (with
PEX_VERBOSE=1
). This reproducer:py2.py3-none-any
wheelThe two ablations, which both succeed:
--lock lock.json
:I'm not 100% sure this is a bug, but I'm suspicious, based on: this is a platform-indepedent package, and it works with the cache pre-seeded or without a lockfile.