Skip to content

Commit

Permalink
add root-user-action=ignore and check for .complete file (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-shibanov committed Mar 9, 2023
1 parent e952c80 commit b539ede
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion installers/macos-pkg-setup-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJOR_MINOR pyt

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

echo "Install OpenSSL certificates"
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"
Expand Down
2 changes: 1 addition & 1 deletion installers/nix-setup-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth

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

echo "Create complete file"
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete
6 changes: 4 additions & 2 deletions installers/win-setup-template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ if ($null -ne $InstalledVersions) {
if (Test-Path -Path $InstalledVersion) {
Write-Host "Deleting $InstalledVersion..."
Remove-Item -Path $InstalledVersion -Recurse -Force
Remove-Item -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete" -Force -Verbose
if (Test-Path -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete") {
Remove-Item -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete" -Force -Verbose
}
}
}
} else {
Expand Down Expand Up @@ -132,7 +134,7 @@ 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"
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location --root-user-action=ignore"

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

1 comment on commit b539ede

@cclauss
Copy link

@cclauss cclauss commented on b539ede Apr 6, 2023

Choose a reason for hiding this comment

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

Is there a Python 3.11.3 release as well?

Please sign in to comment.