mirror of
https://github.com/actions/python-versions.git
synced 2025-04-05 14:59:39 +00:00
add root-user-action=ignore and check for .complete file (#223)
This commit is contained in:
@ -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"
|
||||
|
@ -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
|
||||
|
@ -101,9 +101,11 @@ if ($null -ne $InstalledVersions) {
|
||||
if (Test-Path -Path $InstalledVersion) {
|
||||
Write-Host "Deleting $InstalledVersion..."
|
||||
Remove-Item -Path $InstalledVersion -Recurse -Force
|
||||
if (Test-Path -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete") {
|
||||
Remove-Item -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete" -Force -Verbose
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Host "No Python$MajorVersion.$MinorVersion.* found"
|
||||
}
|
||||
@ -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
|
||||
|
Reference in New Issue
Block a user