Repository navigation
scripts/update_python_zip.py: build python3XY.zip from vcpkg's python3 port - #7101
Merged
Merged
Conversation
… vcpkg bumps thirdparty/python/python312.zip came from python.org's embeddable package (3.12.10), while python312.dll comes from vcpkg (3.12.13). The new scripts/update_python_zip.py reads the python3 port at a vcpkg tag, downloads that CPython source (checked against the port's SHA512), applies the port's patches to Lib/, leaves out what the embeddable package leaves out, and compiles it the same way (-OO, unchecked-hash .pyc). vcpkg-auto-update.yml runs it in every vcpkg bump PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PSF license of CPython v3.12.13 is contained verbatim in the existing Python section of THIRD-PARTY-NOTICES.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
since we have a script to build zip should we really store it in git history, or better just build it on distribution? |
… time Per review, python3XY.zip is not stored in git: distribution steps build it with this script. python312.zip, its readme, the license pin and vcpkg-auto-update.yml are back to master. The script takes --vcpkg-tag (default: config.yml's vcpkg version) and --output (a zip file, or a directory that gets python3XY.zip; default: the current directory). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grantim
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
scripts/update_python_zip.py, which buildspython3XY.zip, the pure-Python standard library of an embedded interpreter, from the CPython sources of vcpkg'spython3port. Distribution steps call it to bundle a standard library that matches the Python vcpkg builds, instead of storing the zip in git.thirdparty/python/python312.zipand the workflows are not changed here.--vcpkg-tag: the vcpkg release tag. Default:vcpkg_versionfrom.github/workflows/config.yml.--output: a zip file, or a directory that getspython3XY.zip. Default: the current directory.What it does:
ports/python3at that vcpkg tag: version, sourceSHA512and patch list.python/cpythonv<version>, the same archivevcpkg_from_githubuses, and checks its SHA512 against the port's.Lib/. Today only0018-fix-sysconfig-include.patchtouchesLib/sysconfig.py.test,tests,idlelib,tkinter,turtledemo,ensurepip,venv,turtle.py,site-packages.-OO, unchecked-hash.pyc, file names relative toLib. It writes the.pycand data files into the zip.The script needs that Python minor version. If it runs under another one and
uvis on PATH, it re-runs itself withuv run --python <X.Y>. It also needsgit(forgit apply) and network access to GitHub.For vcpkg
2026.07.29it builds a 3.79 MB, 596-entry zip from CPython 3.12.13. The committedthirdparty/python/python312.zipis python.org's 3.12.10. Loaded by vcpkg'spython.exe/python312.dll3.12.13 from a folder holding only that zip,json,sysconfig,logging,typing,argparse,unittest,subprocessandxml.dom.minidomimport from it. The extension modules (_socket,_ssl,_sqlite3, ...) are not part of the zip; the distribution has to ship them as files.Why not download the zip from python.org. python.org publishes the Windows embeddable packages (the source of
python3XY.zip) only while a Python series gets bug-fix releases. 3.12 moved to security-fix-only releases after 3.12.10, and from 3.12.11 on python.org ships only the source tarballs. So 3.12.10 is the last 3.12 withpython-3.12.x-embed-*.zip, which is why the committed zip was stuck there, and why there is nothing to download for vcpkg's 3.12.13:python-3.12.10-embed-amd64.zip,-embed-arm64.zip,-embed-win32.zipPython-3.12.11.tgz/.tar.xzonly2026.07.29)Python-3.12.13.tgz/.tar.xzonlyA downloaded zip would also lack the vcpkg port's patches to
Lib/(today0018-fix-sysconfig-include.patch). And a newer series (3.13, 3.14) would have embeddable packages only until it, too, moves to security-fix releases. The script builds from the same source tarball python.org publishes, checked against the port's SHA512, in the embeddable package's format: the same excluded packages,-OO, and unchecked-hash.pyc.🤖 Generated with Claude Code