Strip authentication from editable VCS URLs in pip freeze - #14222
Strip authentication from editable VCS URLs in pip freeze#14222moodyastra wants to merge 4 commits into
Conversation
sepehr-rs
left a comment
There was a problem hiding this comment.
Hi @moodyastra, thanks a lot for your contribution! The implementation looks good to me, and the tests cover it nicely.
One small question though: in _strip_auth_from_editable_requirement, the SSH git user exception checks user_pass == "git" directly against the netloc, so %67%69%74@example.com gets stripped instead of being preserved. The test confirms this is the current behavior. Was that intentional? If so, a brief comment in the code explaining why would help future readers.
|
Thanks for catching that, and for the kind review! Yes, that was intentional. I kept the exception deliberately narrow and consistent with the existing Great point about making that intent clear — I added a brief comment in de6b66f. Thanks again! |
What does this PR do?
Fixes #11410.
Editable VCS installs derive their frozen requirement from the clone's remote URL. This change strips concrete authentication information before
pip freezeemits that requirement, while preserving literal PEP 610 environment-variable references and thegit@user for SSH remotes.It adds an end-to-end regression test and focused coverage for safe and unsafe user-info forms.
PR Checklist:
Assisted-by: OpenAI Codex
Tests
pytest tests/unit/test_operations_freeze.py: 13 passedpytest tests/functional/test_freeze.py: 25 passed, 6 skipped, 1 xfailed