Skip to content

Conversation

@ymyzk
Copy link
Owner

@ymyzk ymyzk commented Oct 21, 2025

Description

This change adds support for Python's free-threading builds (e.g., Python 3.14t) by detecting the Py_GIL_DISABLED configuration variable and appending a "t" suffix to version keys when running on a free-threading build.

Changes include:

  • Updated plugin to check sysconfig.get_config_var("Py_GIL_DISABLED")
  • Added "t" suffix to version keys for free-threading builds
  • Updated documentation with example configuration
  • Added test case for free-threading Python version detection

Expected Behavior

The following example should run py314 on a normal Python 3.14 job and run py314t on a free-threaded Python 3.14 job.

[tox]
envlist = py314, py314t

[gh-actions]
python =
    3.14: py314
    3.14t: py314t

By design, the t suffix is needed even when only free-threaded Python is installed on a job. For example, the following configuration fails to run python3.14t if python3.14t is installed but python3.14 is not installed.

[tox]
envlist = py314

[gh-actions]
python =
    3.14: py314

This change adds support for Python's free-threading builds (e.g., Python 3.14t)
by detecting the Py_GIL_DISABLED configuration variable and appending a "t" suffix
to version keys when running on a free-threading build.

Changes include:
- Updated plugin to check sysconfig.get_config_var("Py_GIL_DISABLED")
- Added "t" suffix to version keys for free-threading builds
- Updated documentation with example configuration
- Added test case for free-threading Python version detection
@ymyzk ymyzk requested a review from Copilot October 22, 2025 14:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Python's free-threading builds (introduced in Python 3.13+) by detecting the Py_GIL_DISABLED configuration variable and appending a "t" suffix to version keys when running on a free-threading build.

  • Detects free-threading builds using sysconfig.get_config_var("Py_GIL_DISABLED")
  • Appends "t" suffix to all Python version keys (CPython, PyPy, Pyston) when free-threading is enabled
  • Updates documentation with example configuration for py314t environment

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tox_gh_actions/plugin.py Adds free-threading detection and appends "t" suffix to version keys when Py_GIL_DISABLED == 1
tests/test_plugin.py Adds test case for free-threading Python 3.14 version detection with mocked Py_GIL_DISABLED config variable
README.md Documents free-threading Python configuration with example showing py314 and py314t environments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ymyzk ymyzk merged commit dd8e04b into master Oct 22, 2025
54 checks passed
@ymyzk ymyzk deleted the free-threading branch October 22, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants