Repository navigation
Fix vendored Pipenv hash export breaking pip (#981) - #1731
Merged
Mikola Lysenko (mikolalysenko) merged 3 commits intoOct 26, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Pipenv 2023.7.9 and later export a vendored `file` entry from Pipfile.lock without `--hash` in `pipenv requirements --hash`, while every registry entry keeps its hashes. pip then turns on hash-checking mode and refuses the whole `pip install -r`, so Docker builds that use that export break after switching to vendored mode, with no warning. No lock shape avoids it, so a vendored Pipenv run that wires the lock now warns `pypi_pipenv_hash_export_unsupported` whenever another lock entry carries hashes, naming the remedies: export without `--hash`, or use hosted mode, whose `#sha256=` URL exports a hash pip accepts. The Pipenv compatibility notes, ecosystems table and CLI contract document the limitation. Fixes #981 Assisted-by: Claude Code:claude-opus-5-5
Review follow-ups for the #981 warning. Skip it when the probed Pipenv is a 2022 or older release, whose export keeps the vendored wheel's hash. Keep warning on an in-sync re-run, since the export gap outlives the run that wired the lock. Name the vendored package and a hashed entry that turns on pip's hash-checking mode. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 26, 2026 17:32
Collaborator
Author
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 958a972. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 26, 2026
Collaborator
Author
|
Burn-down agent: Ready for review at
Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-pipenv-hash-export-warning
branch
October 26, 2026 18:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #981
Summary
After
scan --mode vendoredon a Pipenv project,pipenv requirements --hash > requirements.txt && pip install -r requirements.txtfails outright: the vendored wheel line has no--hash, every other line does, and pip's hash-checking mode refuses the whole install. Before this PR the CLI exited 0 with no warning, and the docs listedpipenv requirementsas supported.Vendored Pipenv runs now warn
pypi_pipenv_hash_export_unsupportedwhenever the export would break. The warning names the vendored package, a hashed entry that turns hash checking on, and the two remedies: export without--hash, or use--mode hosted, whose#sha256=URL exports a hash pip accepts. The limitation is documented indocs/testing/pipenv-compatibility.md,docs/ecosystems.mdand the CLI contract warning table.Root cause
Pipenv 2023.7.9 and later never print
--hashforfile/pathlock entries when exporting (the bisect on #981 pins the release). A vendoredPipfile.lockroutes the patched package through a relativefileentry, so this can't be fixed in the lock: the bisect found that a#sha256=fragment on the relative path breakspipenv sync. The only correct fix on our side is to tell the user, the same wayvendor_integrity_unverifiedandpypi_pipenv_stale_installcover Pipenv's other gaps.When it warns
hashes, nofile/path/VCS/editable key). Without one, the export has no--hashline and pip never turns hash checking on.file:///<abs> --hash=…, and earlier releases have norequirementscommand.Review findings not changed (
/code-review high)develop, though plainpipenv requirementsexports onlydefault): not changed.--devand--categoriesexports combine categories, and those exports do fail, so the warning is right for the common Docker recipe that installs dev deps. The message says "an export holding both".Test evidence
Red → green regression tests for #981:
vendor::pypi_pipenv::tests::hash_export_warning_when_other_entries_are_hashedfailed against a stub that never warns (panicked at pypi_pipenv.rs) and passes with the fix. It covers a hashed sibling in the same category, one indevelop, the message contents, and installer gating (2026 warns, 2022 doesn't).vendor::pypi_pipenv::tests::hash_export_warning_absent_without_other_hashed_entries: the target alone, and a sibling that is itself afileentry.vendor::pypi::tests::pipenv_vendor_warns_the_hash_export_gap(orchestrator, mock patch service) failed with the call site removed and passes with it. It covers a lone target (no warning), a hasheddevelopsibling (warns, lock wired), an in-sync re-run (still warns), and a pinned Pipenv 2022 (no warning).Local gates at
958a972:cargo fmt --all -- --check: cleancargo clippy --workspace --all-features -- -D warnings: cleancargo test -p socket-patch-core --lib pipenv: 116 passedcargo test --workspace --all-features --no-fail-fast: 14,978 passed, 11 failed, all environmental and none in Pipenv code: 9 write-failure fixtures that rely onchmod 0o555, which root (this sandbox runs as uid 0) bypasses (pypi_requirements/pypi_poetrywire-failure,copy_tree,vlt_heal, the repair/redirect write-failure CLI tests), and 2e2e_bun_lockbtests that reachpatches-api.socket.dev, which the sandbox proxy blocks. CI runs as non-root with networkdocker_e2e_vendor_pypi_pm) needs a Docker daemon this sandbox lacks, so CI runs it. Its fixture locks onlysix, so the new warning doesn't fire there.Per-issue checklist:
pipenv requirements --hash|pip install -ron Pipenv 2023+: the vendored wheel is exported without a hash, so pip's hash-checking mode refuses the whole install #981:pypi_pipenv_hash_export_unsupportedwarning plus docs; tests listed above. The issue asked for a real export fix if one exists. None does (see the bisect), so it's covered as a documented limitation with a warning, which the issue named as the expected outcome.No wrapper (
npm/,pypi/,gem/) changes: they pass warnings through unchanged.https://claude.ai/code/session_011qh1KydriBiRyb8hiHmfrw
Generated by Claude Code