Produce redistributable builds of Python
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Use patch files for Windows source changes (#1388) Windows builds encode fixed CPython and OpenSSL changes as inline replacements, and the xz fallback can leave a partially modified project when a later replacement fails. Move these edits into version-selected patches applied with `git apply`, normalizing line endings for CRLF project files and failing the build when a patch no longer applies. Build-specific paths and versions remain generated in Python. Remove the obsolete `_sqlite3.vcxproj` and `_freeze_importlib` rewrites for the supported CPython versions. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com> | 12 天前 | |
Update to patchelf 0.19.2 (#1416) * patchelf 0.13.1 -> 0.19.2 Drop the inline patch adding support for LoongArch64 as this is included in this version. | 8 天前 | |
Update Windows libffi to 3.4.4 (#1417) * libffi 3.4.2 -> 3.4.4 (Windows) Windows builds compile libffi from python/cpython-source-deps, pinned to the 3.4.2 import. On 32-bit x86, libffi 3.4.2 corrupts the stack when a stdcall callback receives an 8-byte argument that is not 8-byte aligned (python/cpython#82929). COM servers written with comtypes hit this and crash with an access violation, as I reported in #601. CPython's own Windows builds use libffi 3.4.4 for every version built here, so it makes sense to follow upstream here. This pr therefore pins the `libffi-3.4.4` tag, so the Windows builds match python.org. Linux and macOS builds are unchanged. CPython's `test_i38748_stackCorruption` covers this bug. It was marked as an expected failure on i686-pc-windows-msvc and now passes. That has also been taken care of in this pr by removing the expected failure. I againt produced the crash from #601 on the current 3.13 x86 build. Replacing only its `libffi-8.dll` with the 3.4.4 DLL that CPython ships works properly. I'm Opening this as a draft until this has been built for x86. If a maintainer could possibly add `arch:x86`, I'd really appreciate that. Note that this currently overlaps with #1408, which moves the same commit hash into a constant. Cc @jjhelmus, happy to rebase if your work gets accepted. closes #601 | 8 天前 | |
Use patch files for Windows source changes (#1388) Windows builds encode fixed CPython and OpenSSL changes as inline replacements, and the xz fallback can leave a partially modified project when a later replacement fails. Move these edits into version-selected patches applied with `git apply`, normalizing line endings for CRLF project files and failing the build when a patch no longer applies. Build-specific paths and versions remain generated in Python. Remove the obsolete `_sqlite3.vcxproj` and `_freeze_importlib` rewrites for the supported CPython versions. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com> | 12 天前 | |
update libX11 and xorgproto (#1418) * libX11 1.8.13 -> 1.8.14 * xorgproto 2025.1 -> 2026.1 | 8 天前 | |
Check for musl-static releases in update_downloads.py (#1414) The lack of the update script detecting this caused #1413 to be delayed. | 8 天前 | |
Retry GitHub release uploads on HTTP 408 (#1407) Treat HTTP 408 responses as transient so release asset uploads use the existing retry and exponential backoff policy. | 10 天前 | |
Use patch files for Windows source changes (#1388) Windows builds encode fixed CPython and OpenSSL changes as inline replacements, and the xz fallback can leave a partially modified project when a later replacement fails. Move these edits into version-selected patches applied with `git apply`, normalizing line endings for CRLF project files and failing the build when a patch no longer applies. Build-specific paths and versions remain generated in Python. Remove the obsolete `_sqlite3.vcxproj` and `_freeze_importlib` rewrites for the supported CPython versions. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com> | 12 天前 | |
macos: initial support for macOS Various features aren't yet implemented. But it should be "good enough" to facilitate experimentation. | 7 年前 | |
convert docs to markdown, build using mkdocs and add action to publish to astral-sh/docs (#1234) Covert the project documentation to markdown from restructured text. Build the project documentation using mkdocs. The existing Sphinx based process is retained until the new docs are confirmed working and in place. Add a new action to build and publish documentation to astral-sh/docs. This action was based largely off the action from ruff. --------- Co-authored-by: Ee Durbin <ewdurbin@gmail.com> | 1 个月前 | |
Initial commit | 7 年前 | |
use uv to bootstrap the host system Python environment (#892) Add a new build script which uses uv to bootstrap the Python environment on the host and runs the build. To use this new script on a host with uv installed use: ``` ./build-uv.py ``` | 10 个月前 | |
Add information about pbs performance (#1192) Add a document (`BENCHMARKS.md`) which discusses the performance on python-build-standalone in pyperformance benchmarks compared to other CPython distributions. --------- Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com> | 2 个月前 | |
Run a smaller subset of targets on pull requests by default (#1075) Currently, pull requests run all targets by default and labels can be used to select a subset of the matrix. However, CI is quite expensive and it's very rare to need to test the whole matrix, so the default is a bit backwards. In this change, we update pull requests to run on a subset of targets by default: Python 3.14 on macOS, Linux, and Windows with the most popular architecture. We include both glibc and musl variants of Linux. We include armv7 as an arbitrary cross-compile case — I'd be happy to take suggestions on an alternative there. This breaks our labeling concept a bit, as our labels currently do pure subsetting of the matrix. The labels will continue to subset, but with some nuances: - Applying a label will generally subset the default selection, e.g., `platform:linux` will only run the Linux subset of the defaults described above. - Labels that would null the default subset, e.g., `python:3.12` or `build:debug`, will instead change the default set to target that variant. - There are new `platform:all`, `python:all`, `arch:all`, `libc:all`, and `build:all` labels that can be used to expand the targets. | 6 个月前 | |
Bump rustls from 0.23.45 to 0.23.46 (#1422) Bumps [rustls](https://github.com/rustls/rustls) from 0.23.45 to 0.23.46. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/rustls/rustls/commit/f04804fa13341a9b1dc02b5d1dd8a746f2c4b7fb"><code>f04804f</code></a> Delay saving KX hint until handshake confirmation</li> <li><a href="https://github.com/rustls/rustls/commit/049d39b975ef5c39f546a10fa03d420dcf053510"><code>049d39b</code></a> Bump version to 0.23.46</li> <li><a href="https://github.com/rustls/rustls/commit/6d0ba089d6d446959d113bdad43042780949ba48"><code>6d0ba08</code></a> Eliminate secret from impl Debug for <code>ServerSessionValue</code></li> <li><a href="https://github.com/rustls/rustls/commit/2b82b8141ae090fa193a9961705598b81d3aae9c"><code>2b82b81</code></a> unbuffered: update TLS 1.3 traffic keys before exhausting them</li> <li><a href="https://github.com/rustls/rustls/commit/74343e7047d7179b9bd7e67cef543b6c490518a1"><code>74343e7</code></a> conn: update TLS 1.3 traffic keys within fragmented writes</li> <li><a href="https://github.com/rustls/rustls/commit/795eea719e9491ee45aae38acc62a60a98969fbe"><code>795eea7</code></a> Advance the HPKE sequence only after seal succeeds</li> <li><a href="https://github.com/rustls/rustls/commit/d67cb716e6a086a9d88b69b966ab10c470087119"><code>d67cb71</code></a> stream: provide backpressure while buffering received plaintext</li> <li><a href="https://github.com/rustls/rustls/commit/7a69adee8fb37d17f1af241e44212bc83a911804"><code>7a69ade</code></a> util: fuse flushes from connections with errors</li> <li><a href="https://github.com/rustls/rustls/commit/493d08934775c115b2e6d6727789dd359850070b"><code>493d089</code></a> conn: fuse writes for connections with errors</li> <li><a href="https://github.com/rustls/rustls/commit/db00e0187de977ab6f1018d8158511ba4432c53c"><code>db00e01</code></a> util: keep flushing after short writes</li> <li>Additional commits viewable in <a href="https://github.com/rustls/rustls/compare/v/0.23.45...v/0.23.46">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/astral-sh/python-build-standalone/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 7 天前 | |
Bump the rust group across 1 directory with 22 updates (#1357) Co-authored-by: Alex Waygood <alex.waygood@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> | 14 天前 | |
Remove CPython 3.10 from build matrix and releases (#1332) Remove CPython 3.10 from the build matrix and future release. Note that 3.10 can still be built manually using the build.py script. Closes #1328 | 22 天前 | |
license: update LICENSE file to MPL 2.0 It was errantly BSD 3-clause in this file despite MPL headers on ~all source files. MPL 2.0 is the license we actually use. Closes #297. | 2 年前 | |
licenses: add files with licenses We previously tracked all licenses in the python-licenses.rst file. We still do. But this commit introduces per-project files to hold their respective licenses. We also annotate downloads.py with the license file and the SPDX short license name. | 7 年前 | |
licenses: add files with licenses We previously tracked all licenses in the python-licenses.rst file. We still do. But this commit introduces per-project files to hold their respective licenses. We also annotate downloads.py with the license file and the SPDX short license name. | 7 年前 | |
license: synchronize CPython license The CPython license is a little out of date. Let's synchronize it. | 4 年前 | |
unix: build expat from source Similar deal as mpdecimal. We want to link against a standalone built library instead of using the version in CPython. | 3 年前 | |
linux: build libX11 from source and use for tk build This does a lot of things. Most notably the subject line. We also split up tcl and tk into separate packages. Chasing the long tail of libX11's dependencies was a PITA. We still don't build the _tkinter extension. I think we still need to work on making libX11 a static library. | 7 年前 | |
linux: build libX11 from source and use for tk build This does a lot of things. Most notably the subject line. We also split up tcl and tk into separate packages. Chasing the long tail of libX11's dependencies was a PITA. We still don't build the _tkinter extension. I think we still need to work on making libX11 a static library. | 7 年前 | |
licenses: add files with licenses We previously tracked all licenses in the python-licenses.rst file. We still do. But this commit introduces per-project files to hold their respective licenses. We also annotate downloads.py with the license file and the SPDX short license name. | 7 年前 | |
license: refresh libffi license Minor updates to the years. | 4 年前 | |
Upgrade xz from 5.2.12 -> 5.8.1 (#853) In version 5.6.0 and newer, liblzma is licensed under the BSD Zero Clause License (0BSD). | 11 个月前 | |
licenses: add files with licenses We previously tracked all licenses in the python-licenses.rst file. We still do. But this commit introduces per-project files to hold their respective licenses. We also annotate downloads.py with the license file and the SPDX short license name. | 7 年前 | |
linux: build libX11 from source and use for tk build This does a lot of things. Most notably the subject line. We also split up tcl and tk into separate packages. Chasing the long tail of libX11's dependencies was a PITA. We still don't build the _tkinter extension. I think we still need to work on making libX11 a static library. | 7 年前 | |
unix: build mpdecimal from source This is the first step in providing our own mpdecimal library instead of using the one bundled with CPython. This commit only builds the library: we don't yet use it when building CPython. | 3 年前 | |
license: refresh ncurses license Minor updates to years. | 4 年前 | |
unix: add support for and use OpenSSL 3.0.10 Now that the OpenSSL version is parameterized we can add OpenSSL 3.x build support with little effort. The OpenSSL 3 license changed to Apache 2.0. And its build system would default to `lib64` instead of `lib` for the library directory in some configurations. And the set of available hashing algorithms changes. Probably the most annoying change here was dealing with libatomic. It looks like OpenSSL 3 links against libatomic in many scenarios. Clang ships a dynamic libatomic.so by default. So if we're not careful we get a run-time dependency on libatomic.so. We work around this by using the `-l:libatomic.a` linker flag syntax when building/linking CPython extensions using libcrypto to force the symbols to get linked statically. We choose to use OpenSSL 3.0 even though 3.1 is available because 3.0 is an LTS release and has a longer support window. And CPython right now appears to be using 3.0 more than 3.1. While 3.1 appears to work (I initially used 3.1 before downgrading to 3.0), OpenSSL compatibility has historically had quirks with CPython and I don't want to venture too far into uncharted territory with 3.1. We still need Windows support. But at least macOS and Linux are out of the way.o Part of #178. | 3 年前 | |
licenses: add files with licenses We previously tracked all licenses in the python-licenses.rst file. We still do. But this commit introduces per-project files to hold their respective licenses. We also annotate downloads.py with the license file and the SPDX short license name. | 7 年前 | |
linux: build _tkinter extension The last commit did the heavy lifting of getting tcl/tk built from source. This commit puts the final touches on things so we can enable the _tkinter extension module. We had to tweak the tcl/tk build settings a bit. We also defined missing license annotations for those packages. With this commit `import tkinter` works from a standalone executable! Although there may be some paths leaking into the binary creating problems for compatibility on different distros. But at least we're past the milestone of building the extension! | 7 年前 | |
linux: build tix Tix is required by tkinter. | 7 年前 | |
Add zlib-ng and zstd licenses (#1341) Add the zlib-ng and zstd licenses which are referenced in `PYTHON.json`. Add a check during validation that all license files references in PYTHON.json exist in the archive. | 15 天前 | |
licenses: add files with licenses We previously tracked all licenses in the python-licenses.rst file. We still do. But this commit introduces per-project files to hold their respective licenses. We also annotate downloads.py with the license file and the SPDX short license name. | 7 年前 | |
Add zlib-ng and zstd licenses (#1341) Add the zlib-ng and zstd licenses which are referenced in `PYTHON.json`. Add a check during validation that all license files references in PYTHON.json exist in the archive. | 15 天前 | |
Add CPython 3.16 (#1336) Add CPython 3.16.0a1 --------- Co-authored-by: Zanie Blue <contact@zanie.dev> | 22 天前 | |
rewrite R2 publishing in Python (#1051) This rips out the mirror uploading logic from the `pythonbuild` rust CLI and moves it to Python, mainly because the rust aws sdk is clearly not mature enough to support our use case, as evidenced by https://github.com/astral-sh/python-build-standalone/issues/1047 I've also had to start using `--no-dev` on some existing `uv run` invocations because `moto` wouldn't cleanly install in some build jobs (like when building CPython for Windows). ## Test plan Apart from unit tests, there's now an integration test with a local, mocked S3 provider (using `moto`). Dry run release on this branch: https://github.com/astral-sh/python-build-standalone/actions/runs/23550742376 | 7 个月前 | |
use ty for Python type checking (#1300) Use ty for Python type checking and remove mypy. Fix issues identified by ty. | 1 个月前 | |
Run a smaller subset of targets on pull requests by default (#1075) Currently, pull requests run all targets by default and labels can be used to select a subset of the matrix. However, CI is quite expensive and it's very rare to need to test the whole matrix, so the default is a bit backwards. In this change, we update pull requests to run on a subset of targets by default: Python 3.14 on macOS, Linux, and Windows with the most popular architecture. We include both glibc and musl variants of Linux. We include armv7 as an arbitrary cross-compile case — I'd be happy to take suggestions on an alternative there. This breaks our labeling concept a bit, as our labels currently do pure subsetting of the matrix. The labels will continue to subset, but with some nuances: - Applying a label will generally subset the default selection, e.g., `platform:linux` will only run the Linux subset of the defaults described above. - Labels that would null the default subset, e.g., `python:3.12` or `build:debug`, will instead change the default set to target that variant. - There are new `platform:all`, `python:all`, `arch:all`, `libc:all`, and `build:all` labels that can be used to expand the targets. | 6 个月前 | |
Remove obsolete Linux build Dockerfiles (#1399) Remove the unused Debian Jessie and Debian 9 Dockerfiles and the unused Rust image. Cross builds now use the Debian 13 x86-64 GCC image for host toolchains. The musl toolchain depends on this docker image which is now specified in the Makefile. | 10 天前 | |
Use a native arm64 compiler on Windows and migrate to VS 2026 image (#1272) Use a native arm64 tools to build the arm64 distributions on Windows. Previously 32-bit x86-cross-arm64 tools were used that ran under the Windows emulation layer on an arm64 host. Migrate to a Windows arm images that uses VS 2026. The existing image is scheduled for migrate Sep 21-30. | 1 个月前 | |
Add CPython 3.16 (#1336) Add CPython 3.16.0a1 --------- Co-authored-by: Zanie Blue <contact@zanie.dev> | 22 天前 | |
Require hashes for build dependencies (#1333) Enable `require-build-hashes` for the Python projects and inline scripts so isolated builds require declared hashes for their build dependencies. Pin the build backends and their dependencies with hashes. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com> | 22 天前 | |
Refresh README and docs introduction (#1298) Convert README to markdown with sections similar to other Astral projects. Reuse this as the introduction and update the docs URL to docs.astral.sh. | 1 个月前 | |
Require hashes for build dependencies (#1333) Enable `require-build-hashes` for the Python projects and inline scripts so isolated builds require declared hashes for their build dependencies. Pin the build backends and their dependencies with hashes. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com> | 22 天前 | |
macos: build and link against libedit libreadline is GPL v3. Python supports linking against libedit, which has a more permissive license. So, this commit teaches the build system to build libedit and to link the readline extension against it. Doing this with our custom-built ncurses resulted in a failure to find the terminfo database. The workaround is to build/link against the system ncurses. I'm not sure if this is ideal, as it leaves a dependency on libraries in /usr/lib. But it is the easiest way to make the "readline" module work. I'll have to research how all this stuff works and see if we can ship ncurses safely on macOS. | 7 年前 | |
Add Ruff and mypy configuration files (#283) ## Summary I think it's useful that running `ruff check` or `mypy` enforces the configuration we enforce in CI. | 2 年前 | |
Update Windows libffi to 3.4.4 (#1417) * libffi 3.4.2 -> 3.4.4 (Windows) Windows builds compile libffi from python/cpython-source-deps, pinned to the 3.4.2 import. On 32-bit x86, libffi 3.4.2 corrupts the stack when a stdcall callback receives an 8-byte argument that is not 8-byte aligned (python/cpython#82929). COM servers written with comtypes hit this and crash with an access violation, as I reported in #601. CPython's own Windows builds use libffi 3.4.4 for every version built here, so it makes sense to follow upstream here. This pr therefore pins the `libffi-3.4.4` tag, so the Windows builds match python.org. Linux and macOS builds are unchanged. CPython's `test_i38748_stackCorruption` covers this bug. It was marked as an expected failure on i686-pc-windows-msvc and now passes. That has also been taken care of in this pr by removing the expected failure. I againt produced the crash from #601 on the current 3.13 x86 build. Replacing only its `libffi-8.dll` with the 3.4.4 DLL that CPython ships works properly. I'm Opening this as a draft until this has been built for x86. If a maintainer could possibly add `arch:x86`, I'd really appreciate that. Note that this currently overlaps with #1408, which moves the same commit hash into a constant. Cc @jjhelmus, happy to rebase if your work gets accepted. closes #601 | 8 天前 | |
Port `verify_distribution.py` into `pythonbuild` (#1058) We move the custom `unittest` based tests from this file into a new `pythonbuild/disttests` package, deleting `src/verify_distribution.py` in the process. We teach the new `pythonbuild.testdist` code to run our custom unittests given an extracted Python distribution. They now run by default. Rust code for executing the Python in the distribution has been removed. CI tests have been updated to invoke `test-distribution.py` when we support running the interpreter. Behavior of `test-distribution.py` / `pythonbuild.disttests` has been changed so stdlib tests are no longer run by default. This is necessary to preserve backwards compatibility to keep CI passing. Functionality is still a bit klunky IMO. I'll clean up the CLI UX a bit in future commits. | 7 个月前 | |
Update graphql-core to 3.2.12 (#1420) | 8 天前 |
以下内容由 AI 翻译,如有问题请 点此提交 issue 反馈
Python Build Standalone
自包含、可移植、高性能的 Python 发行版。
亮点
- 高性能, 速度不逊于甚至快于其他 CPython 发行版。
- 可移植,可安装到任意路径。
- 自包含,已集成扩展模块和依赖项。
- Python 3.11-3.16。
- 标准构建和自由线程构建。
- 支持 Linux、macOS 和 Windows。
- 支持多种平台和架构。
- 可直接搭配 uv 使用,或从 发布存档中直接使用。
Python Build Standalone 由 Astral 维护,该团队同时也是 uv、ruff 和 ty 背后的开发团队。
快速上手
使用这些发行版最常见的方式是搭配 uv。运行以下命令即可安装受管理的 Python:
uvx --managed-python python
选择特定的 Python 版本或自由线程构建:
uvx --managed-python python@3.13
uvx --managed-python python@3.14+freethreaded
下载
预构建的发行版可在 GitHub Releases 上获取。
请根据您的 Python 版本、操作系统和架构选择合适的压缩包。
大多数用户应选择 install_only 压缩包;full 压缩包还包含用于创建自定义 Python 发行版的构建产物。
有关可用格式的详细信息,请参阅发行版压缩包。