[3006.x] Disable pip's periodic version check in salt-pip (#70024) - #70025
Merged
dwoz merged 2 commits intoAug 13, 2026
Merged
Conversation
`salt-pip` shells out to `python -m pip` against a packager-pinned onedir pip; pip's periodic "A new release of pip is available" HTTPS check is pure noise (the user can't do anything about it) and a proxy-config gotcha (cf. saltstack#69910). `salt/modules/pip.py` already suppresses it on 6 install/list/upgrade paths; salt-pip should too. Set `PIP_DISABLE_PIP_VERSION_CHECK=1` in `_pip_environment` via `setdefault` so operators can opt back in by exporting `PIP_DISABLE_PIP_VERSION_CHECK=0` before invoking salt-pip. Fixes saltstack#70024
The unit tests on `_pip_environment` prove the helper injects `PIP_DISABLE_PIP_VERSION_CHECK=1` (and respects an operator override) but would still pass if a future refactor stopped routing `salt_pip` through `_pip_environment`. Add two end-to-end tests that drive `salt.scripts.salt_pip` with a stubbed `subprocess.run` and assert on the `env` dict actually handed to the child `python -m pip` process. Refs saltstack#70024
twangboy
approved these changes
Aug 13, 2026
BrianHa94
approved these changes
Aug 13, 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.
Fixes #70024
salt-pipshells out topython -m pipagainst a packager-pinned onedir pip, so pip's periodic "A new release of pip is available" HTTPS check is pure noise and a proxy-config gotcha (cf. #69910).salt/modules/pip.pyalready suppresses it on 6 code paths; salt-pip should too.Sets
PIP_DISABLE_PIP_VERSION_CHECK=1in_pip_environmentviasetdefault(env-var, not argv) so user-passed pip subcommands stay untouched and operators can opt back in by exportingPIP_DISABLE_PIP_VERSION_CHECK=0.Regression tests in
tests/pytests/unit/test_scripts.py. Merge-forward will propagate to 3007.x/3008.x/master.