Repository navigation
Fix vendored Pipenv pylock.toml co-wiring (#1368) - #1399
Open
Mikola Lysenko (mikolalysenko) wants to merge 5 commits into
Open
Mikola Lysenko (mikolalysenko) wants to merge 5 commits into
Mikola Lysenko (mikolalysenko) wants to merge 5 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
With `[pipenv] use_pylock = true`, `pipenv lock` writes a pylock.toml beside Pipfile.lock, and PEP 751 installers (`uv pip install -r pylock.toml`, pip) install from it. Vendored mode wired only Pipfile.lock and named the pylock as an unpatched install source, so `vendor --check` and `vex` reported contested wiring, and re-running vendor changed nothing, so the suggested remedy looped. Vendoring a Pipenv project now also points the pylock's entry for the package at the same committed wheel. The ledger entry records it, revert restores it, a superseding patch re-wires it, and a re-run over an already wired Pipfile.lock wires a pylock made since. A pylock that can't be rewritten in place (a symlink, a non-registry source) is still named by pypi_multiple_lockfiles. Refs #1368 Assisted-by: Claude Code:claude-opus-5-5
A Pipenv entry now also records the pylock wired beside Pipfile.lock. Repair stopped at that pylock record when it carried no hash-pinned wheel, instead of falling back to the Pipfile.lock digests it used before. It now reads the Pipfile.lock fragment as it did. The real-Pipenv use_pylock e2e now expects the pylock to point at the vendored wheel too. Refs #1368 Assisted-by: Claude Code:claude-opus-5-5
- A pylock already pointing at another patch's wheel that no ledger entry records is named in pypi_multiple_lockfiles instead of being silently treated as wired. - A superseding patch whose old pylock wiring drifted refuses, as a drifted Pipfile.lock does, and --dry-run now predicts that refusal. - A drifted pylock on revert keeps every file wired (Pipfile.lock and the export too), so the tree matches the kept ledger entry instead of being half reverted. - A pylock Hatch derives for locked environments is left alone. - Repair reads a Pipenv entry's Pipfile.lock fragment whatever order its records are in. - The real-Pipenv e2e now installs from the wired pylock with `uv pip install -r pylock.toml` and checks it gets the patched six. Refs #1368 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 11, 2026 21:16
Collaborator
Author
|
BugBot review Generated by Claude Code |
The Pipenv pylock probe read pyproject.toml and hatch.toml with a plain read, so a FIFO at either path blocked the vendor run forever. It now uses the same regular-file read as flavor detection. Refs #1368 Assisted-by: Claude Code:claude-opus-5-5
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 b5a3675. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 11, 2026
Collaborator
Author
|
Ready for review at
Generated by Claude Code |
This branch has not been deployed
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 #1368
Summary
With
[pipenv] use_pylock = true,pipenv lockwrites apylock.tomlbesidePipfile.lock. PEP 751 installers (uv pip install -r pylock.toml, pip) install from it. Vendored mode now wires that pylock to the same committed wheel as Pipfile.lock, sovendor --checkandvexstop reporting contested wiring and installs from the pylock get the patched package.This finishes #1368: its uv-export lane was fixed by #1390, and this PR covers the remaining Pipenv pylock lane.
Root cause
detect_pypi_flavorrouted a Pipenv project with both locks to Pipfile.lock (#1122), and named a pylock that pins the package as apypi_multiple_lockfilesloser. Nothing ever wired it, so the "rewire both locks" remedy looped. Pipenv co-wiring (#1309, #1390) covered only an exported requirements.txt.Change
pypi_lock::pipenv_pylocksclassifies each Pipenv pylock that holds the package: on the registry (wirable), already on a vendored wheel (with its uuid), or unwirable (a symlink, a non-registry source). Hatch-derived locked-env pylocks are left out.python_lock_document). A refusal puts back every file already written.--dry-runpredicts that refusal.pypi_multiple_lockfiles.pypi_pipenv_pylock_wired).pypi_multiple_lockfilesrow and the pipenv-compatibility table.Test evidence
Red on unchanged code (
cargo test -p socket-patch-core --lib -- vendor::pypi::tests::pipenv_: 6 failed), green with the fix:pipenv_vendor_wires_the_pipenv_pylockpipenv_pylock_dry_run_previews_the_wiringpipenv_in_sync_rerun_wires_a_later_pylock_oncepipenv_superseding_uuid_rewires_the_pylockpipenv_pylock_revert_keeps_both_wired_when_the_lock_failspipenv_pylock_beside_pipfile_lock_routes_to_pipenv(updated) /pipenv_use_pylock_project_vendors_into_pipfile_lock(updated)pipenv_symlinked_pylock_beside_pipfile_lock_is_a_loserpipenv_pylock_probe_skips_a_fifo_hatch_file,pipenv_pylock_on_an_unrecorded_patch_is_named,pipenv_superseding_uuid_refuses_a_drifted_pylock_in_dry_run_too,pipenv_pylock_drift_keeps_every_file_wired,pipenv_leaves_a_hatch_locked_env_pylock_alonerecover_pypi_urlless_locks_report_no_fetchable_url(extended)pipenv::pipenv_pylock_projects_wire_what_pipenv_installs(real Pipenv 2026.8.0)pipenv install --deploypatched;uv pip install -r pylock.tomlinstalls the patched sixCommands run locally:
cargo fmt --all -- --check: okcargo clippy --workspace --all-features -- -D warnings: okcargo test -p socket-patch-core --all-features --lib: 6306 passed. 4 failed, and the same 4 fail onmainin this sandbox because they rely on file permissions that root bypasses (copy_tree::relax_loop_must_not_traverse_symlinked_root,vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry,pypi_poetry::wire_write_failure_*,pypi_requirements::wire_failure_rolls_back_*).cargo test -p socket-patch-cli --all-features --test mode_migration_pypi: 58 passedSOCKET_PATCH_PIPENV_E2E_REQUIRED=1 SOCKET_PATCH_PIPENV_E2E_VERSIONS=2026.8.0 cargo test -p socket-patch-cli --all-features --test e2e_vex_build -- pipenv:: --ignored: 2 passedcargo test --workspaceran out of the sandbox's disk while linking. CI runs the full matrix.No wrapper changes are needed:
npm/,pypi/andgem/only dispatch to the binary./code-review high findings not fixed
pipenv_superseding_uuid_drifted_entry_refuses). The old entry holds the only pre-vendor originals.Compatibility
An older binary reverting a Pipenv entry that has pylock records gives the
python_lock_documentrecords to the Pipfile.lock backend, which reports them as drifted and keeps the entry. That is the ledger's documented forward-compatibility behavior.🤖 Generated with Claude Code
https://claude.ai/code/session_01WU8SL8CcLJsyMHUF4HRaTn
Generated by Claude Code