From c13d998c03ec5268b5b6c361fe0c65854041b684 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 6 Mar 2025 19:45:41 -0500 Subject: [PATCH 1/2] Test on free-threaded Python See #2005. Right now, this does not limit by operating system, but that is just to verify that there are no OS-specific 3.13t problems we should know about right now; once that is verified, the macOS and Windows jobs will be removed (excluded) for the time being. The 3.13t jobs added here use `Quansight-Labs/setup-python`, not `actions/setup-python`. The latter also has the ability to use 3.13t since https://github.com/actions/python-versions/pull/319 and https://github.com/actions/setup-python/pull/973 (see also https://github.com/actions/setup-python/issues/771), but no version tag includes this feature yet. It can be used by using `@main` or `@...` where `...` is an OID. The former would risk pulling in other untested features we're no trying to test with, while the latter would not be easy to upgrade automatically as what we have now (we would be deliberately keeping a hash not at any tag that is already not the latest hash on any branch). In contrast, the `Quansight-Labs/setup-python` fork adds this feature while staying up to date with others. When `actions/setup-python` has a release (stable or prerelease) with this feature, we can switch to it. This could probably be done with less code duplication by using a matrix variable for the action to use. Instead, the "Set up Python" step is split in two, with opposite `if` conditions, so that each is capable of being recognized and upgraded by Dependabot if a new major version is released (in case this ends up remaining in place longer than expected). --- .github/workflows/pythonpackage.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 039699af5..b24c5cc57 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os-type: [ubuntu, macos, windows] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"] exclude: - os-type: macos python-version: "3.7" # Not available for the ARM-based macOS runners. @@ -40,11 +40,20 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} + if: |- + !endsWith(matrix.python-version, 't') uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} allow-prereleases: ${{ matrix.experimental }} + - name: Set up Python ${{ matrix.python-version }} (free-threaded) + if: endsWith(matrix.python-version, 't') + uses: Quansight-Labs/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: ${{ matrix.experimental }} + - name: Set up WSL (Windows) if: matrix.os-type == 'windows' uses: Vampire/setup-wsl@v5.0.0 From 56038c3e0382d87ccdb66d53964f038314c157fd Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 6 Mar 2025 22:39:23 -0500 Subject: [PATCH 2/2] Only test free-threaded Python on Linux For now, this omits macOS and Windows from the 3.13t ("threaded") tests. The plan in #2005 is to start without them, and no OS-specific problems have been identified so far. In particular, in the previous commit that adds 3.13t without excluding any operating systems, all tests in the macOS job passed as expected, and the Windows job had the same failure with the same message as in #1955, with no XFAIL changed to XPASS (which, if present, would suggest GC differences meriting further exploration of 3.13t on Windows). --- .github/workflows/pythonpackage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b24c5cc57..661df0693 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -17,8 +17,12 @@ jobs: exclude: - os-type: macos python-version: "3.7" # Not available for the ARM-based macOS runners. + - os-type: macos + python-version: "3.13t" - os-type: windows python-version: "3.13" # FIXME: Fix and enable Python 3.13 on Windows (#1955). + - os-type: windows + python-version: "3.13t" include: - os-ver: latest - os-type: ubuntu