Skip to content

Use pip from specified python cmd - #2115

Merged
twangboy merged 2 commits into
saltstack:developfrom
heewa:use-same-pip-as-python
Sep 2, 2026
Merged

Use pip from specified python cmd#2115
twangboy merged 2 commits into
saltstack:developfrom
heewa:use-same-pip-as-python

Conversation

@heewa

@heewa heewa commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Tries to use a pip that's matched to the specified python cmd, either:

  1. <python_cmd> -m pip (eg python3.14 -m pip)
  2. pip<py_version> (eg pip3.14)
    • tries to retain some of the old "try to find a pip" behavior, but restricted to a version match

What issues does this PR fix or reference?

When a version of python is specified (eg with -x python3.14 arg to the bootstrap script), but a corresponding pip command isn't available, the old behavior was to try using a pip of the major version (eg pip3), but this is problematic if that version of pip does exist, but doesn't match the python version used to build packages. That results in:

  • packages being successfully built
  • successfully installed, but into a different python version
  • therefore salt doesn't run with the given python cmd

@twangboy twangboy self-assigned this Jun 26, 2026
Comment thread bootstrap-salt.sh Outdated
Comment thread bootstrap-salt.sh Outdated
Comment thread bootstrap-salt.sh
@twangboy
twangboy force-pushed the use-same-pip-as-python branch from 46bbbe4 to 87cf647 Compare August 31, 2026 19:35
@twangboy
twangboy enabled auto-merge (rebase) September 2, 2026 17:33
heewa and others added 2 commits September 2, 2026 11:34
…llback

Check the exit status of '$_pip_cmd --version' directly instead of
relying on captured-output emptiness, silence stderr so a missing
pip module doesn't dump a traceback, and re-capture _pip_version
after the pip${_py_version} fallback succeeds so it isn't reported
empty even though a working pip binary was found.
@twangboy
twangboy force-pushed the use-same-pip-as-python branch from 87cf647 to 0ae25f3 Compare September 2, 2026 17:34
@twangboy
twangboy disabled auto-merge September 2, 2026 17:34
@twangboy
twangboy merged commit 618dcdb into saltstack:develop Sep 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants