ouroboros/scripts/download_python_standalone.ps1
Ouroboros d54e93ce35 synthesis step 1: transplant p34-converged functional range 7caf7c1..5cde01f
Range transplant via merge-tree with merge-base=7caf7c1 (contaminated-history
branch contributes its post-terminal delta only; D27). 65 files. All 8 conflict
blocks were version carriers, resolved to the base side (6.87.6) per the
single-final-bump policy (C7); the api_types.js conflict additionally dropped
the terminal typedef block the incoming side inherited from 7caf7c1, and the
README conflict dropped intermediate 6.88.x changelog rows carrying private
SHAs. PTY scan of the result: clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 15:34:37 +03:00

59 lines
2.2 KiB
PowerShell

# Downloads python-build-standalone for Windows (x86_64)
# Run from repo root: powershell -ExecutionPolicy Bypass -File scripts/download_python_standalone.ps1
$ErrorActionPreference = "Stop"
$Release = "20260211"
$PyVersion = "3.10.19"
$Dest = "python-standalone"
$Platform = "x86_64-pc-windows-msvc"
# Pinned SHA256 (from the release's SHA256SUMS): a swapped/truncated archive
# fails here instead of becoming the packaged runtime. Update the pin when
# bumping $Release/$PyVersion, exactly as in download_python_standalone.sh.
$Sha256 = "b892f2c7eb0a04611688d6df7567a2745a204aac694d6d1c56c75b0717dab2d6"
$Filename = "cpython-${PyVersion}+${Release}-${Platform}-install_only_stripped.tar.gz"
$Url = "https://github.com/astral-sh/python-build-standalone/releases/download/${Release}/${Filename}"
Write-Host "=== Downloading Python ${PyVersion} for ${Platform} ==="
Write-Host "URL: ${Url}"
if (Test-Path $Dest) { Remove-Item -Recurse -Force $Dest }
if (Test-Path "_python_tmp") { Remove-Item -Recurse -Force "_python_tmp" }
New-Item -ItemType Directory -Path "_python_tmp" | Out-Null
$ArchivePath = "_python_tmp\python.tar.gz"
Write-Host "Downloading..."
Invoke-WebRequest -Uri $Url -OutFile $ArchivePath -UseBasicParsing
Write-Host "Verifying SHA256..."
$Actual = (Get-FileHash -Algorithm SHA256 $ArchivePath).Hash.ToLower()
if ($Actual -ne $Sha256.ToLower()) {
throw "SHA256 mismatch for ${Filename}: expected ${Sha256}, got ${Actual} - refusing to install."
}
Write-Host "Checksum OK: ${Actual}"
Write-Host "Extracting..."
tar -xzf $ArchivePath -C "_python_tmp"
Move-Item "_python_tmp\python" $Dest
Remove-Item -Recurse -Force "_python_tmp"
echo ""
Write-Host "=== Installing agent dependencies ==="
& "${Dest}\python.exe" -m pip install --quiet -r requirements.txt
echo ""
Write-Host "=== Installing optional: local model support ==="
try {
& "${Dest}\python.exe" -m pip install --quiet "llama-cpp-python[server]" 2>&1
Write-Host "llama-cpp-python installed successfully"
} catch {
Write-Warning "llama-cpp-python install failed - local model support will not be available"
}
echo ""
Write-Host "=== Done ==="
Write-Host "Python: ${Dest}\python.exe"
& "${Dest}\python.exe" --version