From b4dd4cdda390f2a1ddc17291932438b0a29d0054 Mon Sep 17 00:00:00 2001 From: mayeut Date: Fri, 26 Apr 2024 20:47:44 +0200 Subject: [PATCH 1/3] fix: error out on install failure in "Apply build artifact to the local machine" step --- .github/workflows/build-python-packages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-python-packages.yml b/.github/workflows/build-python-packages.yml index a57d794e..2b80a022 100644 --- a/.github/workflows/build-python-packages.yml +++ b/.github/workflows/build-python-packages.yml @@ -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 { From d05150c17299218791deff36b55d00483efd12a5 Mon Sep 17 00:00:00 2001 From: mayeut Date: Fri, 26 Apr 2024 21:10:28 +0200 Subject: [PATCH 2/3] fix: error out on pip installation / update failure --- installers/win-setup-template.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installers/win-setup-template.ps1 b/installers/win-setup-template.ps1 index f0ea70d5..39a67fc4 100644 --- a/installers/win-setup-template.ps1 +++ b/installers/win-setup-template.ps1 @@ -135,6 +135,9 @@ if ($MajorVersion -ne "2") { Write-Host "Install and upgrade Pip" $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" +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 From 56e722b3940ee7da31700aee7508aa78c79143a4 Mon Sep 17 00:00:00 2001 From: mayeut Date: Fri, 26 Apr 2024 21:22:57 +0200 Subject: [PATCH 3/3] 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 --- installers/nix-setup-template.sh | 3 ++- installers/win-setup-template.ps1 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/installers/nix-setup-template.sh b/installers/nix-setup-template.sh index 32fa2326..1aa0e723 100644 --- a/installers/nix-setup-template.sh +++ b/installers/nix-setup-template.sh @@ -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 diff --git a/installers/win-setup-template.ps1 b/installers/win-setup-template.ps1 index 39a67fc4..12dca02b 100644 --- a/installers/win-setup-template.ps1 +++ b/installers/win-setup-template.ps1 @@ -133,8 +133,9 @@ 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" }