chore: merge tooling batch

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 15:57:19 +01:00
commit b90f8bb0b9
116 files changed
+12868 -9741

No files matched your search

+16 -21
View File
@@ -16,7 +16,7 @@
# and Invoke-WebRequest throws on a cut transfer before the hash is read:
# the site's build rewrites this line there (scripts/sitebootstrap.py).
$mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that."
$defaultInstallSha256 = "993f6128d67d32a96bcacb83ca542ef745701a2f98eb348330a1e86728ba597a"
$defaultInstallSha256 = "f0410caadbcc354efc86038decb95da63478ddf018cad03ec09e41ce2b5e4d63"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
@@ -68,35 +68,30 @@
$installer = $temporary
}
# The py launcher first, then python3 and python. The Microsoft Store
# places a python.exe that only points at the Store: it fails the
# version check like a missing one.
$findPython = {
$found = Get-Command py -ErrorAction SilentlyContinue
if ($found) { return ,@($found, @("-3")) }
foreach ($name in @("python3", "python")) {
$found = Get-Command $name -ErrorAction SilentlyContinue
if ($found) { return ,@($found, @()) }
}
return $null
}
$usable = {
param($candidate)
if (-not $candidate) { return $false }
$arguments = $candidate[1]
& $candidate[0].Source @arguments -c "import sys, ssl, unicodedata, zlib; raise SystemExit(sys.version_info < (3, 8))" 2>$null | Out-Null
& $candidate[0].Source @arguments -c "import sys; raise SystemExit(sys.version_info < (3, 8))" | Out-Null
return ($LASTEXITCODE -eq 0)
}
# The py launcher first, then python3 and python, the first that
# passes the check: a py launcher left with no usable runtime hid a
# Python 3.12 on PATH. The Microsoft Store places a python.exe that
# only points at the Store: it fails the check like a missing one.
$findPython = {
$candidates = @()
$found = Get-Command py -ErrorAction SilentlyContinue
if ($found) { $candidates += ,@($found, @("-3")) }
foreach ($name in @("python3", "python")) {
$found = Get-Command $name -ErrorAction SilentlyContinue
if ($found) { $candidates += ,@($found, @()) }
}
foreach ($candidate in $candidates) {
if (& $usable $candidate) { return ,$candidate }
}
return $null
}
$needPython = "Python 3.8 or newer is required. Install it with " +
"'winget install Python.Python.3.12' or from https://www.python.org/downloads/ " +
"(tick 'Add python.exe to PATH'), then open a new PowerShell window and run this command again."
$candidate = & $findPython
if (-not $candidate) {
if (-not (& $usable $candidate)) {
# winget ships with Windows 10 and 11: at a console the bootstrap
# offers to run the install the message names, then carries on.
$winget = Get-Command winget -ErrorAction SilentlyContinue
@@ -114,7 +109,7 @@
$candidate = & $findPython
}
}
if (-not $candidate) { throw $needPython }
if (-not (& $usable $candidate)) { throw $needPython }
}
$python = $candidate[0]
$launcher = $candidate[1]