Repository navigation
Fix Pipenv requirements remedy categories (#1507) - #1508
Merged
Mikola Lysenko (mikolalysenko) merged 2 commits intoOct 14, 2026
Merged
Mikola Lysenko (mikolalysenko) merged 2 commits into
Mikola Lysenko (mikolalysenko) merged 2 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
The remedy for a stale base-interpreter copy in a --site-packages
venv printed `pipenv requirements --categories "packages docs"` when
the package sat in several lock categories, one of them named.
Pipenv 2022.12.x-2023.2.4 read that as one category the lock lacks,
so the export was empty, pip exited 0 and the venv kept importing
the unpatched copy while the warning repeated.
The export now names comma-joined lock keys ("default,docs"), which
every Pipenv release with --categories reads. The sync remedies keep
the Pipfile names `pipenv sync` takes.
Fixes #1507
Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 13, 2026 23:01
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 9d5027f. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 13, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-pipenv-requirements-categories
branch
October 14, 2026 00:00
This was referenced Oct 14, 2026
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 #1507
Summary
Socket Patch prints a remedy when a
--site-packagesPipenv venv imports anunpatched copy from its base interpreter (#1450). If the package was pinned in
several lock categories and at least one was named (
[packages]+[docs],[dev-packages]+[docs], …), the remedy printedpipenv requirements --categories "packages docs". On Pipenv2022.12.x–2023.2.4 that export is empty, so the follow-up
pip install -rinstalled nothing and exited 0. The venv kept the unpatchedcopy and the warning came back on the next scan.
The export now names comma-joined lock keys
(
--categories "default,docs"), which every Pipenv release that has--categoriesreads. Thepipenv syncremedies are unchanged and keep thePipfile names that
synctakes.Root cause
install_over_command(crates/socket-patch-core/src/vendor/pypi_pipenv.rs)reused
sync_args, which joins Pipfile names with spaces. That's correct forpipenv sync, butpipenv requirementsbefore 2023.2.18 splits--categorieson commas and looks each name up as a raw lock key. The fixadds
requirements_args, which keepssync_args' plain/--devforms andrenders named categories as comma-joined lock keys. Hosted and vendored
modes both go through this one function, so both are fixed. The npm, PyPI and
gem wrappers don't touch this code.
Test evidence
New
base_site_remedy_exports_comma_joined_lock_keyscoversdefault+docs, develop+docs, default+develop+docs+tests and docs-only for
both base-interpreter remedies. It also asserts that
syncstill takesPipfile names. The existing Pipenv stale-install remedy can't replace a base-interpreter copy in a
--site-packagesvenv:pip uninstallrefuses it andpipenv synckeeps it, so following the warning leaves the package unpatched #1450 test's expectation was updated.cargo test -p socket-patch-core --lib base_site: 2 failed).cargo test -p socket-patch-core --lib pypi_pipenv: 33 passed.Real Pipenv run against the issue's lock (
default: idna, six;develop: six;docs: six):pipenv requirements --categories …"packages docs"(old)"dev-packages docs"(old)"default,docs"(new)"develop,docs"(new)"default,develop,docs"(new)"docs"(new, single)cargo fmt --all -- --check: clean.cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-cli --all-features --lib: 919 passed.cargo test -p socket-patch-core --all-features: 6460 passed, 4 failed.The 4 failures are permission tests (
copy_treesymlinked root,vlt_healunremovable lock,pypi_poetry/pypi_requirementswritefailure). They can't fail as intended under root in this container, and
they fail the same way with this PR's change reverted. CI runs as non-root.
The full
cargo test --workspacehit this container's disk allowancewhile linking integration-test binaries (no test failed), so CI's full run
is the check for those suites. No CLI integration test asserts this remedy
string.
Per-issue checklist
pipenv requirements --categories "packages docs", which Pipenv 2022.12.x–2023.2.4 export as empty, so following it installs nothing (exit 0) #1507:base_site_remedy_exports_comma_joined_lock_keys(red → green), plus the updatedbase_site_stale_install_remedy_installs_over_the_base_copy/code-review high findings not fixed
escaped. This predates the PR:
sync_argshas always inserted namesas-is. Pipenv's own
--categoriesparsing can't express such nameseither.
scripts/backtest-pipenv.py) never runs thebase-interpreter remedy, so it doesn't run the multi-category export. Adding
that scenario is a separate change. I checked this PR by hand against real
Pipenv releases (table above).
--categoriesprefix. Adevelop-only pin exports
--dev, which also coversdefault. Bothpredate the PR and this fix doesn't change them.
--site-packagesvenv:pip uninstallrefuses it andpipenv synckeeps it, so following the warning leaves the package unpatched #1450 assertion and the new table isintentional: it keeps the original test's coverage of the full remedy text.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CdJ5dk71VDEiEYvkU3ULap
Generated by Claude Code