Repository navigation
Fix vendored Pipenv sibling requirements.txt (#612) - #1309
Merged
Mikola Lysenko (mikolalysenko) merged 10 commits intoOct 10, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Pipenv project often installs through a `pipenv requirements > requirements.txt` export (Docker, plain pip). Vendored mode wired only Pipfile.lock, so that path kept installing the unpatched release, and the hosted -> vendored takeover turned the export's hosted pin back into a plain PyPI pin. Re-running vendor answered `already_vendored`, so `vendor --check` and `vex` stayed red. Vendoring a Pipenv entry now also rewrites an exact registry pin of the package in requirements.txt (or an in-root `-r` include) to the same committed wheel, the way hosted mode rewrites both files. The ledger entry records both, every revert restores both, a superseding patch re-wires both, and a re-run over an already wired Pipfile.lock wires a newly made export. Pins the requirements wiring cannot rewrite stay named by `pypi_multiple_lockfiles`. Fixes #612 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Pipenv project often keeps a requirements.txt exported by `pipenv requirements` for Docker or plain pip installs. Vendored mode wired only Pipfile.lock, so `pip install -r requirements.txt` kept installing the unpatched release, and a hosted to vendored switch turned that file's patched pin back into a registry pin. A fresh Pipenv vendor now wires the root requirements.txt (and its -r includes) along with Pipfile.lock when it pins the package, and revert restores both. If the lock is wired but the requirements file can't be, the vendor fails as a whole and the lock is put back. A requirements file that can't be co-wired, or a project vendored before this change, is still named in the loud pypi_multiple_lockfiles warning. Refs #612 Assisted-by: Claude Code:claude-opus-5-5
`vendor --check` and `vex` read lockfile discovery. With Pipfile.lock and requirements.txt both pointing at the same vendored wheel, the regression test now checks that discovery finds the patch in both files and reports no contest between them. Refs #612 Assisted-by: Claude Code:claude-opus-5-5
The hosted -> vendored takeover test asserted the old warning that requirements.txt stays UNPATCHED; it now asserts that the export's pin is wired to the vendored wheel too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Another session pushed a co-wiring implementation to this branch while this one was finishing its own. Keep this branch's implementation (which also covers the CLI e2e, the in-sync re-run, the superseding re-vendor and the docs) and carry over that attempt's core test, which also checks that discovery finds both files with nothing contested. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 9, 2026 19:26
Collaborator
Author
Collaborator
Author
|
BugBot review |
Mikola Lysenko (mikolalysenko)
enabled auto-merge
October 9, 2026 19:26
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d3f6c30. Configure here.
Pick up #1336 (Hatch-derived pylock.toml lock-only rewrite); merges cleanly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Mikola Lysenko (mikolalysenko)
requested review from
Tanmay Singla (Tanmay182003) and
Wenxin Jiang (Wenxin-Jiang)
October 10, 2026 09:28
- An in-sync re-run whose committed wheel is missing now rebuilds it and then wires the pending exported requirements pin, instead of returning after the rebuild with the export still on the registry. - The in-sync sibling wiring pins only a committed wheel that verify_committed_artifact accepts (canonical path for this uuid, ledger sha256, afterHashes), and wire/rewire_requirements refuse a wheel path or digest that is not a single plain token (no CR/LF, whitespace or #). - Re-wiring after a re-export replaces the entry's requirements_line records for that file instead of appending duplicates, so a later superseding patch can still re-wire the export. - revert_pipenv_with_sibling reverts the export first and restores it if the Pipfile.lock revert then fails, so neither failure leaves the two files half reverted. - Moves wire_requirements' doc comment back onto it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tanmay Singla (Tanmay182003)
approved these changes
Oct 10, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/v5-pipenv-vendor-sibling-reqs
branch
October 10, 2026 17:41
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 #612 (the requirements.txt lanes). The Pipenv
pylock.tomland uv-export lanes from the issue comments are split out to #1368.Summary
A Pipenv project often installs through a
pipenv requirements > requirements.txtexport, for Docker or plain pip. Before this PR:Pipfile.lock, so that path kept installing the unpatched release. Decide which lockfile governs installs in one table #1044 made this loud, but it was still unpatched.vendoransweredalready_vendored, sovendor --checkandvex(whose remedy says "re-run vendor") stayed red.Root cause
The vendored flavor router picks one flavor (
pipenv), and only that flavor's file is wired. The exported requirements pin was only ever named as apypi_multiple_lockfilesloser.Fix (core
vendor/pypi.rs,vendor/pypi_requirements.rs)sibling_pin_wirablechecks whether the requirements set (rootrequirements.txtand in-root-rincludes) pins the package exactly from the registry, in a shape the requirements wiring rewrites in place. It never appends a line. When it does, the Pipenv plan also rewrites that pin to the same committed wheel (hashed or not, following the file), and the records go into the same ledger entry. If the requirements write fails after the lock was written,Pipfile.lockis put back.Pipfile.lock. A pin the wiring can't rewrite (a range, extras, an include outside the root) stays loud.vendor --revert,remove,rollback, the takeover): records are split by kind.Pipfile.lockrecords go throughrevert_pipenvandrequirements_linerecords throughrevert_requirements, so both files come back.pypi_requirements_sibling_wired). Without a ledger entry it stays a named loser.pypi_multiple_lockfilesrow) anddocs/testing/pipenv-compatibility.mdare updated.Coordination: another session pushed a parallel attempt to this branch (872c692, c17e5d8) while this one was finishing. d3f6c30 merges it: it keeps this branch's implementation, which also covers the CLI e2e, the in-sync re-run, supersede and docs items that attempt listed as remaining, and carries over its core test.
Pipfile.lockwriting is untouched apart from makingLOCK_FILEpub(super), so this shouldn't conflict with #1188.Tests (per issue)
mode_migration_pypi::pipenv_vendor_wires_the_exported_requirements_toocovers a fresh vendor, an export reached through-r req/base.txt, an export added after a first vendor (the re-run wires it), and the hosted → vendored takeover. In each case both files point at the vendored wheel,vendor --checkexits 0, and the revert restores the export byte for byte andPipfile.locksemantically.pipenv_hosted_to_vendored_keeps_the_requirements_patched: the Decide which lockfile governs installs in one table #1044 takeover test now asserts the new contract (export vendored, nothing UNPATCHED).pipenv_vendor_wires_the_exported_sibling_requirements(from the parallel attempt). Discovery finds both files with nothing contested, and the revert is byte-identical.requirements_beside_the_governing_lock_is_a_loud_loserwas updated (Pipenv's wirable export is quiet, a range stays loud).Red→green: before the fix the CLI test failed on the vendor envelope's "requirements.txt will still install the UNPATCHED" warning.
Commands run
cargo test -p socket-patch-core --lib: all pass.vendor::pypiis 415 tests.cargo test -p socket-patch-cli --all-features --no-fail-fast: all pass except twoe2e_vendor_cargo_buildold-toolchain cells. Those fail locally withBad CPU type in executable(an x86 rustup toolchain on arm64), a host issue.cargo clippy --workspace --all-features -- -D warningsandcargo fmt --check: clean for the changed files.🤖 Generated with Claude Code
Note
Medium Risk
Touches PyPI vendored wiring, revert, and ledger semantics for Pipenv; mistakes could leave mixed patched/unpatched install paths or partial reverts.
Overview
Vendored Pipenv now patches the common
pipenv requirements > requirements.txtinstall path alongsidePipfile.lock, matching hosted mode. Exact registry pins in the root file or in-root-rincludes are rewritten to the same.socket/vendor/pypi/<uuid>/wheel, recorded on one ledger entry, and restored together onvendor --revert. Pins that cannot be rewritten (ranges, etc.) still triggerpypi_multiple_lockfiles.Behavior changes: hosted→vendored takeover no longer leaves the export on plain PyPI; in-sync re-runs extend the ledger and wire a late-added export (
pypi_requirements_sibling_wired); supersede re-vendors re-wire prior requirements lines; failed sibling wiring rolls backPipfile.lock.Collateral: production e2e/backtest harnesses pin a new free minimist@1.2.2 patch UUID and updated patched hash; vlt backtest
holds()resolves patch file paths with or without apackage/prefix. Docs (CLI_CONTRACT.md,pipenv-compatibility.md) and tests cover the new contract.Reviewed by Cursor Bugbot for commit d3f6c30. Configure here.