mirror of
https://github.com/fergalmoran/picard.git
synced 2026-04-18 02:15:09 +00:00
Appveyor: Convert Python install script to PowerShell
Also install Python only if not already on wanted version
This commit is contained in:
13
scripts/win-update-python.ps1
Normal file
13
scripts/win-update-python.ps1
Normal file
@@ -0,0 +1,13 @@
|
||||
$CurrentVersion = python -c "import sys; print('%s.%s.%s' % sys.version_info[0:3])"
|
||||
Write-Output "Python installed: $CurrentVersion, wanted: $env:PYTHON_VERSION"
|
||||
|
||||
if ($CurrentVersion -ne $env:PYTHON_VERSION) {
|
||||
$InstallerUrl = 'https://www.python.org/ftp/python/' + $env:PYTHON_VERSION + '/python-' + $env:PYTHON_VERSION + '-amd64.exe'
|
||||
Write-Output "Downloading and installing $InstallerUrl..."
|
||||
(new-object net.webclient).DownloadFile($InstallerUrl, 'python-amd64.exe')
|
||||
python-amd64.exe /quiet InstallAllUsers=1 TargetDir=%PYTHON% Include_doc=0 Include_tcltk=0 Include_test=0
|
||||
python -m ensurepip
|
||||
}
|
||||
|
||||
python --version
|
||||
pip3 --version
|
||||
Reference in New Issue
Block a user