File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 47
47
- template : ../steps/setup-macos-native.yml
48
48
- ${{ if eq(parameters.setupWindows, true) }} :
49
49
- template : ../steps/setup-windows-bash.yml
50
+ - template : ../steps/setup-windows-python.yml
50
51
51
52
- template : ../steps/calculate-config-flags.yml
52
53
Original file line number Diff line number Diff line change
1
+ # The dotnet-*-temp pools don't have Python installed in PATH. Install and set it up here.
2
+ steps :
3
+ - powershell : |
4
+ $url = 'https://www.python.org/ftp/python/3.7.1/python-3.7.1-embed-amd64.zip'
5
+ $checksum = 'C9E6FF79B0B9BAA948E3819334D70FDC9CE2B195DC4948C9D668334AB4FF244E'
6
+
7
+ echo "Creating Python bin dir to add to PATH..."
8
+ $pythonDir = "$(Build.ArtifactStagingDirectory)\python"
9
+ mkdir -f $pythonDir
10
+
11
+ echo "Downloading python from $url..."
12
+ $pythonZip = "$pythonDir\python.zip"
13
+ [Net.ServicePointManager]::SecurityProtocol =
14
+ [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
15
+ Invoke-WebRequest $url -OutFile $pythonZip
16
+ $zipChecksum = (Get-FileHash $pythonZip -Algorithm SHA256).Hash
17
+
18
+ if ($zipChecksum -ne $checksum)
19
+ {
20
+ throw "Downloaded zip SHA256 checksum $zipChecksum doesn't match expected $checksum"
21
+ }
22
+
23
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
24
+ [System.IO.Compression.ZipFile]::ExtractToDirectory($pythonZip, $pythonDir)
25
+
26
+ # Work around https://bugs.python.org/issue34841 causing CoreCLR to fail on script dir import
27
+ rm "$pythonDir\python37._pth"
28
+
29
+ echo "Adding $pythonDir to PATH as AzDO variable for python.exe..."
30
+ $env:PATH = "$pythonDir;" + $env:PATH
31
+ echo "##vso[task.setvariable variable=PATH;]$($env:PATH)"
32
+ displayName : Set up Python
You can’t perform that action at this time.
0 commit comments