Preserve pip patch markers and hash checks - #237
Merged
Merged
Conversation
Keep environment markers ahead of hash options in vendored requirements. Strip hosted inline comments before appending hashes so pip enforces them. Cover marker evaluation with real installs. Assisted-by: Codex:gpt-6-astra
Mikola Lysenko (mikolalysenko)
force-pushed
the
codex/pip-vendor-marker
branch
from
September 14, 2026 18:10
132a2b3 to
4fbb375
Compare
Tanmay Singla (Tanmay182003)
approved these changes
Sep 14, 2026
Mikola Lysenko (mikolalysenko)
added a commit
that referenced
this pull request
Sep 15, 2026
Resolve the conflict in patch/redirect/mod.rs: main (#237) patched the inline requirements.txt rewriter to strip trailing inline comments so the appended --hash is not swallowed into the comment; this branch had already replaced that body with redirect::requirements::rewrite, which splits the comment off outside quotes and re-appends it after the hash. Keep the delegation and update #237's test to expect the preserved comment (hash still active, user note kept). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 Codex:gpt-6-astra
Pip ignores an environment marker placed after a per-requirement
--hashoption. Vendored requirements now put the marker before the hash, sopython_version < "2"skips the wheel on Python 3 and a matching marker installs it.Hosted requirements now remove inline comments before preserving the marker. Previously,
django==3.2.3 ; python_version >= "2" # explanationbecame a URL whose generated--hashwas inside the comment, disabling the intended hash check. Reruns remain stable.Validation:
sixbytes, and verifies byte-for-byte revert.--require-hashesafter the comment fix.These bugs were found while backtesting hosted and vendored pip annotations in https://github.com/SocketDev/depscan/pull/26138. The completed matrix checks all 16 published pip majors; supported installs verify the patched Django file hashes.