8000 fix: always reinstall pip (#271) · actions/python-versions@37e7166 · GitHub
[go: up one dir, main page]

Skip to content

Commit 37e7166

Browse files
authored
fix: always reinstall pip (#271)
* fix: always reinstall pip If the default pip version is also the latest one, then the `pip` executable will be missing as the default pip is installed only as `pip3`/`pip3.x`. In order to always provide a `pip` executable, always reinstall pip. * chore(ci): change default version to 3.12.3 Default to the latest stable version.
1 parent eb9433f commit 37e7166

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

.github/workflows/build-python-packages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Build Python package
2-
run-name: Generate Python ${{ inputs.VERSION || '3.11.0' }}
2+
run-name: Generate Python ${{ inputs.VERSION || '3.12.3' }}
33
on:
44
workflow_dispatch:
55
inputs:
66
VERSION:
77
description: 'Python version to build and upload'
8-
default: '3.11.0'
8+
default: '3.12.3'
99
required: true
1010
PUBLISH_RELEASES:
1111
description: 'Whether to publish releases'
@@ -25,7 +25,7 @@ on:
2525
- 'main'
2626

2727
env:
28-
VERSION: ${{ inputs.VERSION || '3.11.0' }}
28+
VERSION: ${{ inputs.VERSION || '3.12.3' }}
2929
defaults:
3030
run:
3131
shell: pwsh
@@ -67,7 +67,7 @@ jobs:
6767
include: ${{ fromJson(needs.generate_matrix.outputs.matrix) }}
6868
runs-on: ${{ matrix.os }}
6969
env:
70-
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.11.0' }}-${{ matrix.platform }}-${{ matrix.arch }}
70+
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
7171
steps:
7272

7373
- name: Check out repository code
@@ -94,7 +94,7 @@ jobs:
9494
include: ${{ fromJson(needs.generate_matrix.outputs.matrix) }}
9595
runs-on: ${{ matrix.os }}
9696
env:
97-
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.11.0' }}-${{ matrix.platform }}-${{ matrix.arch }}
97+
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
9898
steps:
9999

100100
- name: Check out repository code

installers/macos-pkg-setup-template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJOR_MINOR pyt
7171
echo "Upgrading pip..."
7272
export PIP_ROOT_USER_ACTION=ignore
7373
./python -m ensurepip
74-
./python -m pip install --upgrade pip --disable-pip-version-check --no-warn-script-location
74+
./python -m pip install --upgrade --force-reinstall pip --disable-pip-version-check --no-warn-script-location
7575

7676
echo "Install OpenSSL certificates"
7777
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"

installers/nix-setup-template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth
5151
echo "Upgrading pip..."
5252
export PIP_ROOT_USER_ACTION=ignore
5353
./python -m ensurepip
54-
./python -m pip install --upgrade pip --disable-pip-version-check --no-warn-script-location
54+
./python -m pip install --upgrade --force-reinstall pip --disable-pip-version-check --no-warn-script-location
5555

5656
echo "Create complete file"
5757
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete

installers/win-setup-template.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ if ($MajorVersion -ne "2") {
135135
Write-Host "Install and upgrade Pip"
136136
$Env:PIP_ROOT_USER_ACTION = "ignore"
137137
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
138-
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location"
138+
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade --force-reinstall pip --no-warn-script-location"
139139
if ($LASTEXITCODE -ne 0) {
140140
Throw "Error happened during pip installation / upgrade"
141141
}

0 commit comments

Comments
 (0)
0