-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
pex3 lock export
can turn VCS requirements into PyPI ones, resulting in hash failures
#2416
Comments
It's likely the case the only answer here is to fail fast when exporting a lock with either VCS or Local project requirements since the resulting |
I could imagine it's not implausible that someone takes the output of |
Ok, since I'm confident the current scheme is broken for anyone with VCS or local project requirements (the hash can never match the hash of the pinned artifact currently emitted) I feel safe I don't break anyone using |
Although Pex supports locking VCS requirements and local project requirements, it does so with a be-spoke system for fingerprinting each; as such, the `--hash`es emitted when exporting lock files containing these types of requirements are not actually useable in practice. Continue to support exporting this class of lock file, but warn of the potential problems and offer a new `--format pip-no-hash` mode for the daring. In addition, change the requirements output for this class of lock file to match the input requirement for best fidelity when actually attempting to use the resulting exported requirement file without `--hash`es. Fixes pex-tool#2416
Although Pex supports locking VCS requirements and local project requirements, it does so with a be-spoke system for fingerprinting each; as such, the `--hash`es emitted when exporting lock files containing these types of requirements are not actually useable in practice. Continue to support exporting this class of lock file, but warn of the potential problems and offer a new `--format pip-no-hash` mode for the daring. In addition, change the requirements output for this class of lock file to match the input requirement for best fidelity when actually attempting to use the resulting exported requirement file without `--hash`es. Fixes #2416
It seems like exporting a lockfile with a VCS requirement can sometimes use a
<name>==<version>
specifier in the exportedrequirements.txt
, not<name> @ <url>
as specified in the lockfile. This results in attempting to install different artifacts, with different hashes, to the ones PEX originally selected & hashed.test.lock
:requirements.txt
:Output of
pip install
:This example uses the tagged commit of a version, but the same thing applies to using a non-tagged commit, e.g.
pex @ git+https://github.com/pex-tool/pex@36dd2374569b5f3fbef54918e6ba3bd1ff852b61
(36dd237)The same thing applies to
pex3 lock export-subset
too.The text was updated successfully, but these errors were encountered: