Add Python tools installation from Github releases for Windows (#705)

* Add Toolset provision for Windows
Co-authored-by: MaksimZhukov <v-mazhuk@microsoft.com>
This commit is contained in:
Maksim Petrov
2020-04-30 18:11:40 +03:00
committed by GitHub
parent 42fefbe9fe
commit 0413a02d9a
12 changed files with 303 additions and 61 deletions

View File

@@ -44,21 +44,6 @@ Function NPMFeed-AuthSetup {
$npmrcContent | Out-File -FilePath "$($env:TEMP)/.npmrc" -Encoding utf8
}
Function Set-DefaultPythonVersion {
param(
[Parameter(Mandatory=$true)]
[System.Version] $Version,
[System.String] $Arch = "x64"
)
$pythonPath = $Env:AGENT_TOOLSDIRECTORY + "/Python/${Version}*/${Arch}"
$pythonDir = Get-Item -Path $pythonPath
Write-Host "Use Python ${Version} as a system Python"
Add-MachinePathItem -PathItem $pythonDir.FullName
Add-MachinePathItem -PathItem "$($pythonDir.FullName)\Scripts"
}
Function Set-DefaultRubyVersion {
param(
[Parameter(Mandatory=$true)]
@@ -106,5 +91,4 @@ $ToolVersions.PSObject.Properties | ForEach-Object {
}
}
Set-DefaultPythonVersion -Version "3.7"
Set-DefaultRubyVersion -Version "2.5"