Skip to content

Commit

Permalink
fix: use environment variable for PIP_ROOT_USER_ACTION (#265)
Browse files Browse the repository at this point in the history
* fix: error out on install failure in "Apply build artifact to the local machine" step

* fix: error out on pip installation / update failure

* fix: use environment variable for `PIP_ROOT_USER_ACTION`

This extends the fix from #259 since every platform for 3.8.10 / 3.9.13 has been rebuilt instead of just macOS arm64 being added.

The regression was introduced in #223
  • Loading branch information
mayeut committed Apr 29, 2024
1 parent b643f0d commit 2573fc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-python-packages.yml
Expand Up @@ -123,6 +123,7 @@ jobs:

- name: Apply build artifact to the local machine
run: |
$PSNativeCommandUseErrorActionPreference = $true
if ('${{ matrix.platform }}' -eq 'win32') {
powershell ./setup.ps1
} else {
Expand Down
3 changes: 2 additions & 1 deletion installers/nix-setup-template.sh
Expand Up @@ -49,8 +49,9 @@ fi
chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR python

echo "Upgrading pip..."
export PIP_ROOT_USER_ACTION=ignore
./python -m ensurepip
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location --root-user-action=ignore
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location

echo "Create complete file"
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete
6 changes: 5 additions & 1 deletion installers/win-setup-template.ps1
Expand Up @@ -133,8 +133,12 @@ if ($MajorVersion -ne "2") {
}

Write-Host "Install and upgrade Pip"
$Env:PIP_ROOT_USER_ACTION = "ignore"
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location --root-user-action=ignore"
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location"
if ($LASTEXITCODE -ne 0) {
Throw "Error happened during pip installation / upgrade"
}

Write-Host "Create complete file"
New-Item -ItemType File -Path $PythonVersionPath -Name "$Architecture.complete" | Out-Null

0 comments on commit 2573fc9

Please sign in to comment.