fix: improve wheel download script reliability
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
param(
|
||||
[switch]$NoPause
|
||||
[switch]$NoPause,
|
||||
[string]$IndexUrl = "https://pypi.org/simple"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -130,11 +131,18 @@ function Install-Requirements {
|
||||
& $VenvPython -m pip install --no-index --find-links $WheelDir -r $Req
|
||||
} else {
|
||||
Write-Host "No offline wheels found. Installing dependencies from the network."
|
||||
& $VenvPython -m pip install -r $Req
|
||||
& $VenvPython -m pip install `
|
||||
--index-url $IndexUrl `
|
||||
--trusted-host pypi.org `
|
||||
--trusted-host files.pythonhosted.org `
|
||||
--disable-pip-version-check `
|
||||
--retries 3 `
|
||||
--timeout 60 `
|
||||
-r $Req
|
||||
}
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Dependency installation failed. If the server is offline, run scripts\download_wheels.ps1 on an online machine first and copy vendor\wheels to this server."
|
||||
throw "Dependency installation failed. Check network access to $IndexUrl. If the server is offline, run scripts\download_wheels.ps1 on an online machine first and copy vendor\wheels to this server."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user