Skip to content

Commit 8777228

Browse files
committed
Default free threaded off
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 395919d commit 8777228

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

.github/workflows/check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
py:
26+
- "3.14t"
2627
- "3.14"
2728
- "3.13"
2829
- "3.12"

src/tox/tox_env/python/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import sys
88
import sysconfig
99
from abc import ABC, abstractmethod
10+
from dataclasses import dataclass
1011
from pathlib import Path
1112
from typing import TYPE_CHECKING, Any, List, NamedTuple, cast
1213

@@ -27,14 +28,15 @@ class VersionInfo(NamedTuple):
2728
serial: int
2829

2930

30-
class PythonInfo(NamedTuple):
31+
@dataclass(frozen=True)
32+
class PythonInfo:
3133
implementation: str
3234
version_info: VersionInfo
3335
version: str
34-
free_threaded: bool
3536
is_64: bool
3637
platform: str
3738
extra: dict[str, Any]
39+
free_threaded: bool = False
3840

3941
@property
4042
def version_no_dot(self) -> str:

src/tox/tox_env/python/virtual_env/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ def _get_python(self, base_python: list[str]) -> PythonInfo | None: # noqa: ARG
143143
implementation=interpreter.implementation,
144144
version_info=interpreter.version_info,
145145
version=interpreter.version,
146-
free_threaded=interpreter.free_threaded,
147146
is_64=(interpreter.architecture == 64), # noqa: PLR2004
148147
platform=interpreter.platform,
149148
extra={"executable": Path(interpreter.system_executable).resolve()},
149+
free_threaded=interpreter.free_threaded,
150150
)
151151

152152
def prepend_env_var_path(self) -> list[Path]:

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import sys
5+
import sysconfig
56
from pathlib import Path
67
from typing import TYPE_CHECKING, Callable, Iterator, Protocol, Sequence
78
from unittest.mock import patch
@@ -97,10 +98,10 @@ def get_python(self: VirtualEnv, base_python: list[str]) -> PythonInfo | None:
9798
implementation=impl,
9899
version_info=ver_info,
99100
version="",
100-
free_threaded=False,
101101
is_64=True,
102102
platform=sys.platform,
103103
extra={"executable": Path(sys.executable)},
104+
free_threaded=sysconfig.get_config_var("Py_GIL_DISABLED") == 1,
104105
)
105106

106107
mocker.patch.object(VirtualEnv, "_get_python", get_python)

tox.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
requires = ["tox>=4.24.1"]
2-
env_list = ["fix", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "cov", "type", "docs", "pkg_meta"]
2+
env_list = ["fix", "3.14t", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "cov", "type", "docs", "pkg_meta"]
33
skip_missing_interpreters = true
44

55
[env_run_base]

0 commit comments

Comments
 (0)