From ed7b4d9a3e0090897d19aa1a412f46a0df7fe608 Mon Sep 17 00:00:00 2001 From: Lysandros Nikolaou Date: Mon, 27 May 2024 14:10:51 +0200 Subject: [PATCH] Set up CI for the free threaded build --- .github/workflows/ci.yml | 14 ++++++++++++++ Tools/ci-run.sh | 3 +++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 266c8e83bfd..423f30bb534 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,6 +161,12 @@ jobs: python-version: pypy-3.10 backend: c env: { NO_CYTHON_COMPILE: 1 } + # Free-threading + - os: ubuntu-20.04 + python-version: 3.13-freethreading-dev + backend: "c,cpp" + env: {} + allowed_failure: true # This defaults to 360 minutes (6h) which is way too long and if a test gets stuck, it can block other pipelines. # From testing, the runs tend to take ~20 minutes for ubuntu / macos and ~40 for windows, @@ -186,9 +192,17 @@ jobs: - name: Setup python uses: actions/setup-python@v5.0.0 + if: "!endsWith(matrix.python-version, '-freethreading-dev')" with: python-version: ${{ matrix.python-version }} + - name: Setup python from deadsnakes + uses: deadsnakes/action@v3.1.0 + if: "endsWith(matrix.python-version, '-freethreading-dev')" + with: + python-version: 3.13-dev + nogil: true + - name: Compilation Cache uses: hendrikmuhs/ccache-action@v1.2.12 with: diff --git a/Tools/ci-run.sh b/Tools/ci-run.sh index 915ae7a49b0..10f7dd6e6c2 100644 --- a/Tools/ci-run.sh +++ b/Tools/ci-run.sh @@ -216,6 +216,9 @@ if [[ $TEST_CODE_STYLE != "1" ]]; then fi export CFLAGS="$CFLAGS $EXTRA_CFLAGS" +if [[ $PYTHON_VERSION == *"-freethreading-dev" ]]; then + export PYTHON_GIL=0 +fi python runtests.py \ -vv $STYLE_ARGS \ -x Debugger \