Skip to content

[3006.x] Disable pip's periodic version check in salt-pip (#70024) - #70025

Merged
dwoz merged 2 commits into
saltstack:3006.xfrom
dwoz:dwoz/fix/70024-salt-pip-disable-version-check
Aug 13, 2026
Merged

[3006.x] Disable pip's periodic version check in salt-pip (#70024)#70025
dwoz merged 2 commits into
saltstack:3006.xfrom
dwoz:dwoz/fix/70024-salt-pip-disable-version-check

Conversation

@dwoz

@dwoz dwoz commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #70024

salt-pip shells out to python -m pip against 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.py already suppresses it on 6 code paths; salt-pip should too.

Sets PIP_DISABLE_PIP_VERSION_CHECK=1 in _pip_environment via setdefault (env-var, not argv) so user-passed pip subcommands stay untouched and operators can opt back in by exporting PIP_DISABLE_PIP_VERSION_CHECK=0.

Regression tests in tests/pytests/unit/test_scripts.py. Merge-forward will propagate to 3007.x/3008.x/master.

`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
@dwoz
dwoz requested a review from a team as a code owner August 13, 2026 02:13
@dwoz dwoz added the test:full Run the full test suite label Aug 13, 2026
@dwoz dwoz added this to the Sulphur v3006.28 milestone Aug 13, 2026
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

@charzl charzl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sujitdb sujitdb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dwoz
dwoz merged commit 6c1d1d5 into saltstack:3006.x Aug 13, 2026
902 of 909 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants