Skip to content

Honor proxy settings in pip package version queries (#69910) - #70417

Merged
dwoz merged 2 commits into
saltstack:3008.xfrom
charzl:charzl/fix-69910-pip-version-proxy
Oct 26, 2026
Merged

dwoz merged 2 commits into
saltstack:3008.xfrom
charzl:charzl/fix-69910-pip-version-proxy

Conversation

@charzl

@charzl charzl commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Honor proxy settings when pip.installed checks available package versions during an upgrade. Forward proxy through the state's pre-install check to pip.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=False skips 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-check remains 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 versions and the legacy version-query command.

Merge requirements satisfied?

  • Docs: documented the new proxy parameter on pip.list_all_versions()
  • Changelog: changelog/69910.fixed.md
  • Tests written/updated: proxy command construction and state argument propagation

Validation

  • Added 12 command-construction cases covering modern and legacy pip, no proxy, explicit proxy, global proxy with and without credentials, explicit precedence, and proxy=False.
  • Added three state regression cases exercising pip.installed(upgrade=True) with an explicit URL, None, and False.
  • Python 3.12: 106 tests passed across tests/pytests/unit/modules/test_pip.py, tests/pytests/unit/states/test_pip.py, and tests/unit/states/test_pip_state.py.
  • Ran real pip against a local HTTP proxy serving a test package index. Explicit and global proxy modes both reached the proxy and returned the expected available versions with --disable-pip-version-check retained.
  • All applicable pre-commit hooks passed, including source and test linting.

Comment thread salt/modules/pip.py Resolved
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

1 inactive deployment
ci — ded5a282 Deployed Oct 21, 2026 by dwoz via Build Onedir Packages / macOS (arm64) #27689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Argon v3008.0 test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants