From 7a4e2b9477f1b0a19bf7f86b11b7120203f31f1e Mon Sep 17 00:00:00 2001 From: oliver Date: Tue, 13 Oct 2026 21:46:51 +0800 Subject: [PATCH] Drop docs, stdlib tests and Tk/IDLE from the bundled Python runtime. NetX runs headless; these were ~70MB of the runtime (107MB -> 34MB) and made CI Setups ~30MB larger than local ones. Setup: 105MB (CI) / 75MB -> 67MB. ensurepip stays for venv creation. Co-Authored-By: Claude Opus 5.5 --- packaging/build_release.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/build_release.ps1 b/packaging/build_release.ps1 index 487017b..4137aa2 100644 --- a/packaging/build_release.ps1 +++ b/packaging/build_release.ps1 @@ -216,7 +216,12 @@ if ($CreateVenv) { $spEx = Join-Path $prefix "Lib\site-packages" $robocopy = Join-Path $env:SystemRoot "System32\robocopy.exe" if (-not (Test-Path -LiteralPath $robocopy)) { throw "robocopy_not_found" } - & $robocopy $prefix $rtDir /E /XD $spEx __pycache__ /XF *.pyc /NFL /NDL /NJH /NJS /nc /ns /np | Out-Null + # Headless server: drop docs, the stdlib test suite and Tk/IDLE (~100MB unpacked). + # Keep ensurepip - venv creation needs it. Same result on CI and local builds. + $xdRuntime = @("Doc", "tcl", "Tools", "Lib\test", "Lib\idlelib", "Lib\tkinter", "Lib\turtledemo") | + ForEach-Object { Join-Path $prefix $_ } + $xfRuntime = @("_tkinter.pyd", "tcl86t.dll", "tk86t.dll", "*.pyc") + & $robocopy $prefix $rtDir /E /XD $spEx __pycache__ @xdRuntime /XF @xfRuntime /NFL /NDL /NJH /NJS /nc /ns /np | Out-Null if ($LASTEXITCODE -ge 8) { throw "robocopy_python_runtime_failed: exit $LASTEXITCODE" } $rtPy = Join-Path $rtDir "python.exe"