diff options
Diffstat (limited to 'coin/provisioning/common/windows/python3.ps1')
-rw-r--r-- | coin/provisioning/common/windows/python3.ps1 | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/coin/provisioning/common/windows/python3.ps1 b/coin/provisioning/common/windows/python3.ps1 index 8fbd615c..58cd25c5 100644 --- a/coin/provisioning/common/windows/python3.ps1 +++ b/coin/provisioning/common/windows/python3.ps1 @@ -35,12 +35,14 @@ # This script installs Python $version. # Python3 is required for building some qt modules. param( - [Int32]$archVer=32, - [string]$install_path = "C:\Python36" + [Int32]$archVer, + [string]$sha1, + [string]$install_path, + [string]$version, + [bool]$setDefault=$false ) . "$PSScriptRoot\helpers.ps1" -$version = "3.6.1" $package = "C:\Windows\temp\python-$version.exe" # check bit version @@ -48,11 +50,9 @@ if ( $archVer -eq 64 ) { Write-Host "Installing 64 bit Python" $externalUrl = "https://www.python.org/ftp/python/$version/python-$version-amd64.exe" $internalUrl = "http://ci-files01-hki.intra.qt.io/input/windows/python-$version-amd64.exe" - $sha1 = "bf54252c4065b20f4a111cc39cf5215fb1edccff" } else { $externalUrl = "https://www.python.org/ftp/python/$version/python-$version.exe" $internalUrl = "http://ci-files01-hki.intra.qt.io/input/windows/python-$version.exe" - $sha1 = "76c50b747237a0974126dd8b32ea036dd77b2ad1" } Write-Host "Fetching from URL..." @@ -65,11 +65,19 @@ Remove-Item -Path $package # For cross-compilation we export some helper env variable if (($archVer -eq 32) -And (Is64BitWinHost)) { - Set-EnvironmentVariable "PYTHON3_32_PATH" "$install_path" - Set-EnvironmentVariable "PIP3_32_PATH" "$install_path\Scripts" + if ($setDefault) { + Set-EnvironmentVariable "PYTHON3_32_PATH" "$install_path" + Set-EnvironmentVariable "PIP3_32_PATH" "$install_path\Scripts" + } + Set-EnvironmentVariable "PYTHON$version-32_PATH" "$install_path" + Set-EnvironmentVariable "PIP$version-32_PATH" "$install_path\Scripts" } else { - Set-EnvironmentVariable "PYTHON3_PATH" "$install_path" - Set-EnvironmentVariable "PIP3_PATH" "$install_path\Scripts" + if ($setDefault) { + Set-EnvironmentVariable "PYTHON3_PATH" "$install_path" + Set-EnvironmentVariable "PIP3_PATH" "$install_path\Scripts" + } + Set-EnvironmentVariable "PYTHON$version-64_PATH" "$install_path" + Set-EnvironmentVariable "PIP$version-64_PATH" "$install_path\Scripts" } @@ -88,7 +96,13 @@ Run-Executable "$install_path\Scripts\pip3.exe" "$pip_args install virtualenv wh # Install all needed packages in a special wheel cache directory $python3_wheel_dir="$install_path\python3-wheels" Run-Executable "$install_path\Scripts\pip3.exe" "$pip_args wheel --wheel-dir $python3_wheel_dir -r $PSScriptRoot\..\shared\requirements.txt" -Set-EnvironmentVariable "PYTHON3_WHEEL_CACHE" "$python3_wheel_dir" + +Set-EnvironmentVariable "PYTHON3_WHEEL_CACHE-$version-$archVer" "$python3_wheel_dir" +# PYTHON3_WHEEL_CACHE is already in use so we should keep it pointing to 64 bit default +# wheel cache +if (($setDefault) -And ($archVer -eq 64)) { + Set-EnvironmentVariable "PYTHON3_WHEEL_CACHE" "$python3_wheel_dir" +} # Install PyPDF2 for QSR documentation Run-Executable "$install_path\Scripts\pip3.exe" "$pip_args install PyPDF2" |