mirror of https://github.com/qt/qt5.git
Take proxy into use in python provisioning in windows
Task-number: QTQAINFRA-1669 Change-Id: I2030f244da65e4fd0c3b0be54d941b065f9a180e Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
This commit is contained in:
parent
f5af9f119b
commit
c7562fa8ef
|
@ -117,10 +117,10 @@ function Is64BitWinHost
|
|||
return [environment]::Is64BitOperatingSystem
|
||||
}
|
||||
|
||||
function isProxyEnabled {
|
||||
function IsProxyEnabled {
|
||||
return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').proxyEnable
|
||||
}
|
||||
|
||||
function getProxy {
|
||||
function Get-Proxy {
|
||||
return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').proxyServer
|
||||
}
|
||||
|
|
|
@ -64,10 +64,11 @@ Add-Path "C:\Python27;C:\Python27\Scripts"
|
|||
Run-Executable "C:\Python27\python.exe" "-m ensurepip"
|
||||
|
||||
# Install python virtual env
|
||||
#if (isProxyEnabled) {
|
||||
# Write-Host "Using proxy with pip"
|
||||
# $pip_args = "--proxy=" + (getProxy)
|
||||
#}
|
||||
Run-Executable "C:\Python27\Scripts\pip.exe" "install virtualenv"
|
||||
if (IsProxyEnabled) {
|
||||
$proxy = Get-Proxy
|
||||
Write-Host "Using proxy ($proxy) with pip"
|
||||
$pip_args = "--proxy=$proxy"
|
||||
}
|
||||
Run-Executable "C:\Python27\Scripts\pip.exe" "$pip_args install virtualenv"
|
||||
|
||||
Write-Output "Python = $version" >> ~/versions.txt
|
||||
|
|
|
@ -65,11 +65,12 @@ Set-EnvironmentVariable "PYTHON3_PATH" "$install_path"
|
|||
Set-EnvironmentVariable "PIP3_PATH" "$install_path\Scripts"
|
||||
|
||||
# Install python virtual env
|
||||
#if (isProxyEnabled) {
|
||||
# Write-Host "Using proxy with pip"
|
||||
# $pip_args = "--proxy=" + (getProxy)
|
||||
#}
|
||||
Run-Executable "$install_path\Scripts\pip3.exe" "install virtualenv"
|
||||
if (IsProxyEnabled) {
|
||||
$proxy = Get-Proxy
|
||||
Write-Host "Using proxy ($proxy) with pip"
|
||||
$pip_args = "--proxy=$proxy"
|
||||
}
|
||||
Run-Executable "$install_path\Scripts\pip3.exe" "$pip_args install virtualenv"
|
||||
|
||||
Write-Output "Python3 = $version" >> ~/versions.txt
|
||||
|
||||
|
|
Loading…
Reference in New Issue