From fbdc54321c96a83c4d577dc9c29151e555b69a6c Mon Sep 17 00:00:00 2001 From: Yilei Yang Date: Tue, 24 Feb 2026 06:28:09 +0000 Subject: [PATCH] Add Python 3.14 free threaded mode support. --- .github/workflows/ci-bazel.yml | 2 +- .github/workflows/python.yml | 6 +++--- python/_re2.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-bazel.yml b/.github/workflows/ci-bazel.yml index ca9511967..4a93e8b6c 100644 --- a/.github/workflows/ci-bazel.yml +++ b/.github/workflows/ci-bazel.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] # Keep in sync with python.yml. - ver: ['3.10', '3.11', '3.12', '3.13', '3.14'] + ver: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t'] steps: - uses: actions/checkout@v4.2.2 - uses: bazel-contrib/setup-bazel@0.15.0 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 55aee2c80..f4cb823d2 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -30,7 +30,7 @@ jobs: os: [manylinux_2_28] # Keep in sync with ci-bazel.yml and list below. # Also, when bumping the minimum version, update ../../python/setup.py. - ver: ['3.10', '3.11', '3.12', '3.13', '3.14'] + ver: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t'] env: BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PYTHON: /usr/local/bin/python${{ matrix.ver }} @@ -86,7 +86,7 @@ jobs: # TODO(rsc): Stop cross-compiling now that we don't use macOS 12. # instead, specify `-large` suffix on X64 and `-xlarge` suffix on ARM64. os: [13, 14, 15, 26] - ver: ['3.10', '3.11', '3.12', '3.13', '3.14'] + ver: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t'] env: BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BAZEL_CPU: darwin_${{ matrix.arch.bazel-name }} @@ -149,7 +149,7 @@ jobs: - { name: X86, bazel-name: x64_x86, python-name: win32 } - { name: X64, bazel-name: x64, python-name: win_amd64 } - { name: ARM64, bazel-name: arm64, python-name: win_arm64 } - ver: ['3.10', '3.11', '3.12', '3.13', '3.14'] + ver: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t'] exclude: - arch: { name: ARM64, bazel-name: arm64, python-name: win_arm64 } ver: '3.9' diff --git a/python/_re2.cc b/python/_re2.cc index 22f092b23..8de3b3b67 100644 --- a/python/_re2.cc +++ b/python/_re2.cc @@ -253,7 +253,7 @@ class Filter { std::unique_ptr set_; }; -PYBIND11_MODULE(_re2, module) { +PYBIND11_MODULE(_re2, module, py::mod_gil_not_used()) { // Translate exceptions thrown by py::pybind11_fail() into Python. py::register_local_exception(module, "Error");