Repository navigation
Honor proxy settings in pip package version queries (#69910) - #70417
Merged
dwoz merged 2 commits intoOct 26, 2026
Merged
Conversation
twangboy
requested changes
Oct 19, 2026
Proxy credentials embedded in the --proxy argument are visible to any local user through the process list while pip runs. Pass the proxy to pip through the PIP_PROXY environment variable instead, for install, uninstall and list_all_versions, using a shared helper. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This branch was previously 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.
What does this PR do?
Honor proxy settings when
pip.installedchecks available package versions during an upgrade. Forwardproxythrough the state's pre-install check topip.list_all_versions(), and add proxy support to that execution function.Version queries follow the existing install/uninstall proxy rules: an explicit URL takes precedence over the Minion's global configuration, authenticated global proxies are supported, and
proxy=Falseskips the Minion's global proxy settings. The new optional parameter is appended to the public function signature to preserve positional callers.What issues does this PR fix or reference?
Fixes #69910
Related: #70025 disables pip's periodic self-update check. This PR handles proxy configuration for querying the target package's available versions;
--disable-pip-version-checkremains in the command.Previous Behavior
Installing packages could use the configured proxy while the subsequent
pip index versions <package>query omitted it, causing upgrade checks to fail or time out on networks requiring a proxy.New Behavior
The package version query receives the same explicit or globally configured proxy as installation, for both modern
pip index versionsand the legacy version-query command.Merge requirements satisfied?
proxyparameter onpip.list_all_versions()changelog/69910.fixed.mdValidation
proxy=False.pip.installed(upgrade=True)with an explicit URL,None, andFalse.tests/pytests/unit/modules/test_pip.py,tests/pytests/unit/states/test_pip.py, andtests/unit/states/test_pip_state.py.--disable-pip-version-checkretained.