Repository navigation
Upgrade cibuildwheel to v4.3.3 and test wheels on Python 3.15 - #147
Conversation
cibuildwheel v2.16.5 predates Python 3.15 and can't build or test on
it. Upgrade to v4.3.3 and add cp315 to CIBW_BUILD. The wheel is abi3,
so it is still built only once, on cp39; cibuildwheel reuses it for
cp315 and only runs the tests there.
Side effects of going from v2 to v4, from cibuildwheel's changelog:
- Linux wheels are built on manylinux_2_28 instead of manylinux2014,
so they need glibc 2.28 or newer. CentOS 7 and Amazon Linux 2 users
would fall back to the sdist or the pure-Python wheel. Setting
CIBW_MANYLINUX_{X86_64,AARCH64}_IMAGE to manylinux2014 keeps the old
baseline.
- Each abi3 wheel is checked with abi3audit after repair, and a
failure fails the build.
- Windows wheels are repaired with delvewheel, which bundles any DLLs
the extension links against.
- Wheels are built with `build` instead of `pip wheel`, in environments
without setuptools and wheel preinstalled. Both come from
pyproject.toml's build-system.requires instead.
Python 3.15 removed zipimport.zipimporter.load_module(), which the external function server used to load a zipped environment file. Load it with find_spec()/exec_module() instead. Those methods only exist from Python 3.10, so 3.9 keeps using load_module(); that branch can be removed when 3.9 support is dropped. Use asyncio.get_running_loop() in AwaitableUvicornServer rather than get_event_loop(). Both callers already create it inside a running event loop, so behaviour is unchanged. Add 3.15 to the smoke-test and pre-commit matrices. The cibuildwheel upgrade needed to build and test wheels on 3.15 is in singlestore-labs#147. Tested locally on 3.15.0 against SingleStore 9.1.1 (management tests excluded): 967 passed, 19 skipped, 1 failed, the same results as 3.14. The failure, TestServerProcessMode::test_process_mode_worker_handles_request, also fails on 3.14 on macOS and is unrelated to this change.
|
I ran this branch locally with cibuildwheel v4.3.3 (Linux x86_64, 1.
|
abi3audit, which cibuildwheel v4 runs on abi3 wheels, rejected the extension because the non-static helper exported a _Py* symbol. cibuildwheel v3+ defaults to manylinux_2_28; pin manylinux2014 to keep the glibc 2.17 baseline so older distros still get the C extension.
|
@kesmit13 good catch, thank you!
|
* Add Python 3.15 support Python 3.15 removed zipimport.zipimporter.load_module(), which the external function server used to load a zipped environment file. Load it with find_spec()/exec_module() instead. Those methods only exist from Python 3.10, so 3.9 keeps using load_module(); that branch can be removed when 3.9 support is dropped. Use asyncio.get_running_loop() in AwaitableUvicornServer rather than get_event_loop(). Both callers already create it inside a running event loop, so behaviour is unchanged. Add 3.15 to the smoke-test and pre-commit matrices. The cibuildwheel upgrade needed to build and test wheels on 3.15 is in #147. Tested locally on 3.15.0 against SingleStore 9.1.1 (management tests excluded): 967 passed, 19 skipped, 1 failed, the same results as 3.14. The failure, TestServerProcessMode::test_process_mode_worker_handles_request, also fails on 3.14 on macOS and is unrelated to this change. * Clean up failed environment imports and test the zip loader If the module in a zipped environment file raised while importing, main() left the half-initialized module in sys.modules, and a later import in the same process would return it without retrying. Remove the entry and re-raise, as load_module() did. Add test_asgi_env_file, which runs a zip environment through main() with uvicorn mocked out and checks that its functions are found, and that a failed import leaves nothing in sys.modules. The smoke-test job runs it on every Python version, 3.9 through 3.15, since the loader takes a different path on 3.9 than on 3.10+. --------- Co-authored-by: Your Name <you@example.com> Co-authored-by: Kevin D Smith <ksmith@singlestore.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
cibuildwheel v2.16.5 predates Python 3.15 and can't build or test on it. Upgrade to v4.3.3 and add cp315 to CIBW_BUILD. The wheel is abi3, so it is still built only once, on cp39; cibuildwheel reuses it for cp315 and only runs the tests there.
Side effects of going from v2 to v4, from cibuildwheel's changelog:
buildinstead ofpip wheel, in environments without setuptools and wheel preinstalled. Both come from pyproject.toml's build-system.requires instead.Note
Medium Risk
Changes the release wheel pipeline (cibuildwheel major upgrade, Python 3.15 test matrix, and manylinux image pinning), which affects binary compatibility and publish reliability for all platforms.
Overview
Upgrades the publish workflow from
pypa/cibuildwheel@v2.16.5to v4.3.3 so wheels can be exercised on Python 3.15.CIBW_BUILDnow includescp315-*alongsidecp39-*; because the extension wheel is abi3, cibuildwheel still builds once on 3.9 and reuses that wheel for 3.15 while running tests on both ends of the supported range.To offset cibuildwheel v3+ defaulting Linux builds to manylinux_2_28, the workflow pins
CIBW_MANYLINUX_X86_64_IMAGEandCIBW_MANYLINUX_AARCH64_IMAGEtomanylinux2014, preserving the older glibc baseline so older distros still install the compiled wheel instead of silently falling back to pure Python.In
accel.c, the local UTF-8 helper_PyUnicode_AsUTF8is markedstaticto keep it file-local (avoids clashing with Python’s internal symbol naming during limited-API / abi3 wheel checks).Reviewed by Cursor Bugbot for commit 8ca9937. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit