-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Implement lock file support (Umbrella). #1400
Comments
Some gotchas to avoid in either the initial implementation or with follow-ups:
|
There is one known impossible to handle case: when a #2-style ("platform agnostic") resolve needs to traverse an sdist. The sdist may require being (partially) built to extract python version and dependency metadata (e.g.: executing |
This work seems separable into the following task graph:
Of these tasks, Pants only needs 1, 2a and 3a
|
I think with the addition of |
Pex is generally used to produce an application binary and these traditionally get a lockfile in ecosystems that support them in order to allow reproducible builds of the binary at later dates. Even when Pex is used for other purposes, consumers - namely Pants - have a desire to be able to lock resolves done via Pex. This - in fact - is the primary motivation here.
For the motivating Pants case - and in general - Pex should be able to both produce a lock and consume one. The most robust lock would include all the information needed to exactly reproduce first (user source code via
-D
and runtime options encoded inPEX-INFO
), second? (the Pex runtime packaged in.bootstrap/
and third party code (the distributions installed in.deps/
). The motivating case from Pants only cares about third party locking which is the most complex case; so the rest just describes the requirements for that.--python
/--interpreter-constraint
/--platform
combo used to build the Pex given a single random Pex-compatible interpreter.That's about it for hard requirements. It probably makes sense for the lock to be human readable, but that's clearly not required in any way. All known prior art does this though (Cargo, npm, Pipfile, Poetry, PDM, ...). It probably makes sense to keep the nascent PEP-665 in mind. All that's actually needed though is to output a requirements file using
--hash
and appropriate environment markers to achieve 1-3 above*
. Pip will then do the rest and ensure all resolved dists are bit-for-bit identical.*
1 is actually not achievable in a guaranteed way once you allow 2 fwict. 1 should nearly always still hold, but technically, you could have a resolve given a certain version of Pip one day and then a new version of Pip the next and as long as the new version only includes distributions locked by the 1st version of Pip, the resolve will complete successfully. That new resolve though could include more or less or just plain different subsets of the 2-style lockfile though and you have no way of knowing except by comparing the results of the resolve by hand. To underscore the issue - you don't even need two version of Pip, you could just have certain dists deleted from PyPI between resolves 1 and 2 and the 1st time you get a platform specific wheel forlxml
and the next time you get the slower - different code - pure pythonlxml
- say.The text was updated successfully, but these errors were encountered: