Remove unnecessary executable permission from .ps1 scripts
[kiteware-cmake.git] / .gitlab / ci / python.ps1
blob27f18071a67e0fcc7d51e58759fb9da8af7da93f
1 $erroractionpreference = "stop"
3 $version = "3.11.3"
5 if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") {
6 $sha256sum = "7419B2E98516FBD0B66A1237B80187FFB21D32E47B4A4235C2D9D6379597070F"
7 $arch = "amd64"
8 } elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") {
9 $sha256sum = "03BAD6A7C898FC8F693982437AAB6DB698107B82EA93F76424195AE2C161246C"
10 $arch = "arm64"
11 } else {
12 throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE")
15 $filename = "python-$version-embed-$arch"
16 $tarball = "$filename.zip"
18 $outdir = $pwd.Path
19 $outdir = "$outdir\.gitlab"
20 $ProgressPreference = 'SilentlyContinue'
21 Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$tarball" -OutFile "$outdir\$tarball"
22 $hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
23 if ($hash.Hash -ne $sha256sum) {
24 exit 1
27 Add-Type -AssemblyName System.IO.Compression.FileSystem
28 [System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir\python3")
29 Remove-Item "$outdir\python3\*._pth" # Avoid sys.path specific to embedded python.
30 Remove-Item "$outdir\$tarball"