diff --git a/.gitlab/package.yml b/.gitlab/package.yml index f919671da14..e7d7acf368d 100644 --- a/.gitlab/package.yml +++ b/.gitlab/package.yml @@ -18,6 +18,8 @@ variables: - "cp312-cp312" - "cp313-cp313" - "cp314-cp314" + # TODO(py-315): enable cp315 once manylinux image supports it + # - "cp315-cp315" .AARCH64_IMAGES: &AARCH64_IMAGES - "v85383414-751efc0-manylinux2014_aarch64" @@ -130,6 +132,21 @@ variables: IMAGE_TAG: *AARCH64_IMAGES DD_SERVERLESS_BUILD: "1" +# TODO(py-315): fold back into "build linux" once the manylinux image ships +# a cp315-cp315 interpreter. allow_failure keeps the pipeline green while the +# upstream pypa/manylinux image is catching up to CPython 3.15. +"build linux cp315": + extends: "build linux" + allow_failure: true + parallel: + matrix: + - ARCH_TAG: "amd64" + PYTHON_TAG: "cp315-cp315" + IMAGE_TAG: *X86_64_IMAGES + - ARCH_TAG: "arm64" + PYTHON_TAG: "cp315-cp315" + IMAGE_TAG: *AARCH64_IMAGES + "build macos": extends: .build_base tags: [ "macos:sonoma-$ARCH_TAG", "specific:true" ] diff --git a/setup.py b/setup.py index 361966f30fa..b319a10fd8f 100644 --- a/setup.py +++ b/setup.py @@ -122,6 +122,15 @@ CARGO_TARGET_DIR = NATIVE_CRATE.absolute() / f"target{sys.version_info.major}.{sys.version_info.minor}" DD_CARGO_ARGS = shlex.split(os.getenv("DD_CARGO_ARGS", "")) +if sys.version_info >= (3, 15): + # TODO(py-315): pyo3-build-config 0.27.x (max Python 3.14) may be resolved by cargo + # if the lock file is regenerated without --locked (e.g. in some CI cache scenarios). + # Setting PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 tells pyo3-build-config to bypass + # the max-version check and build via the stable ABI, which is correct since we + # already use py_limited_api="auto" in the RustExtension definition. + # pyo3 0.28+ supports Python 3.15 natively, so this is only a safety net. + os.environ.setdefault("PYO3_USE_ABI3_FORWARD_COMPATIBILITY", "1") + BUILD_PROFILING_NATIVE_TESTS = os.getenv("DD_PROFILING_NATIVE_TESTS", "0").lower() in ("1", "yes", "on", "true") CURRENT_OS = platform.system()