From fc12c7207cc7bccf6b1fc0f2846bf26015df31c6 Mon Sep 17 00:00:00 2001 From: jdeast Date: Thu, 13 Aug 2026 22:43:08 -0400 Subject: [PATCH] Only require jax to build where jaxlib has a wheel The JAX extension is already optional in CMakeLists: it probes for jax.ffi.include_dir() and, when that fails, prints 'Skipping JAX extension' and builds everything else. But pip resolves [build-system] requires in an isolated environment before CMake runs, so that graceful path is unreachable and the pinned jax==0.8.0 makes the extension mandatory in practice. Where jaxlib publishes no wheel this makes the sdist unbuildable. macOS x86_64 is the case that bites: jaxlib's last wheel there is 0.4.38 and jaxlib ships no sdist, so the build fails while installing build dependencies, before any C++ is compiled. Adding an environment marker keeps jax present everywhere wheels are built (the cibuildwheel matrix is linux x86_64, macOS arm64 and win_amd64, all of which have jaxlib wheels), so released wheels are unaffected and still contain the extension. Simply dropping jax from requires would instead have let CMake silently skip the extension during release builds, which is why this uses a marker rather than a removal. --- pyproject.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3dae866..3b28df4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,17 @@ tutorials = ["matplotlib", "scipy", "emcee", "pymc>=5.26.1", "tqdm", "numpyro"] "Bug Tracker" = "https://github.com/exoplanet-dev/celerite2/issues" [build-system] -requires = ["scikit-build-core", "numpy", "pybind11", "jax==0.8.0"] +requires = [ + "scikit-build-core", + "numpy", + "pybind11", + # jax supplies the FFI headers for the optional JAX extension. It is + # skipped where jaxlib publishes no wheel -- macOS x86_64 stops at jaxlib + # 0.4.38 and jaxlib has no sdist -- so that the source build remains + # possible there. CMakeLists already handles a missing jax by printing + # "Skipping JAX extension" and building the rest. + "jax==0.8.0; sys_platform != 'darwin' or platform_machine != 'x86_64'", +] build-backend = "scikit_build_core.build" [tool.scikit-build]