-
-
Notifications
You must be signed in to change notification settings - Fork 27
feat: Include abiflags in version dectection (enabling 3.13t) #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This will break Windows, which doesn't have this attribute, unfortunately. It looks like it can be recovered from |
|
Hello @effigies! First of all, I apologize for the delay in reviewing this PR. I really appreciate your effort in integrating tox and tox-gh-actions for testing across various Python variants, including free-threaded builds. At the same time, I want to carefully design the API to ensure long-term compatibility, as it will be difficult to change once people start relying on it. One major concern with the proposed approach is that the naming convention for tox environments, such as py313t (using a t suffix), is not yet standardized by tox: tox-dev/tox#3391. This means that running In the meantime, we might be able to leverage tox-gh-actions’ environment variable feature to enable matrix builds with free-threaded Python: https://github.com/ymyzk/tox-gh-actions?tab=readme-ov-file#factor-conditional-settings-environment-variable Here's an example I'm thinking of: name: Python package
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
abi: [standard, free-threaded]
python-version: ['3.13', '3.14']
steps:
- ...
- name: Install dependencies
run: python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
env:
ABI: ${{ matrix.abi }}[tox]
envlist = py{313,314}-{standard,freethreaded}
[gh-actions]
python =
3.13: py313
3.14: py314
[gh-actions:env]
ABI =
standard: standard
free-threaded: freethreaded
[testenv:py313-freethreaded]
basepython = python3.13t
[testenv:py314-freethreaded]
basepython = python3.14t
...I’d definitely prefer a simpler solution like your proposal in the future, but I’m hesitant to make this design choice at this stage. Feel free to keep this PR open—I’d love to hear your thoughts and input from the community on this. |
|
I'd love to see this move forward 🙇🏻 |
|
Hello everyone. Thank you, @effigies, again for creating this PR. After reviewing tox's direction to support free-threaded Python and running some experiments locally, I want to take a bit different path for supporting free-threaded builds. I just opened a PR #228 and let me explain my design choices. First, I'd like to focus on supporting only free-threaded Python rather than than supporting arbitrary ABI flags considering that we don't expect many users using other ABI flags and getting ABI flags outside the POSIX environment is not necessarily trivial: https://github.com/ymyzk/tox-gh-actions/pull/199/files#diff-93212929fc29259673ac1c9dac7cb5f003076342a27aca2a67c811af95a5b7bcR165-R167 There's a paved path for detecting whether a Python is free-threaded or not and it's better to use that: The other minor difference is which keys to generate in |
|
Sounds good, thanks for picking this up. My fork works for the repo I was working on, but I'll be happy to switch back to base once your implementation is done. I'll close this. |
Description
Currently, you can install free-threaded Python in GitHub actions (with deadsnakes or uv), and have
tox.inicontain:But the version is detected as
3.13, since only the version information is considered, not the abiflags. This enables abiflags, which in turn enables this use case.This is important for setting conditions in tox that only apply to free-threading builds, such as setting
PYTHONGIL=0or limiting dependencies to those withpy3orcp313twheels.You can see it in action in https://github.com/nipy/nibabel/actions/runs/12217554525/job/34081969908:
Expected Behavior
When detecting a matching Python, 3.13t will be tried before falling back to 3.13 and 3.