Skip to content

Commit 800eca7

Browse files
rgommersdnicolodi
authored andcommitted
TST: skip test that fails under free-threaded CPython for too old Cython
Support for free-threaded CPython in Cython is still a work in progress, see e.g. cython#6137 - this will land in Cython 3.1.0, and the skipped test does pass when using Cython built from the branch in cython#6137.
1 parent ce9982a commit 800eca7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/test_editable.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import os
77
import pathlib
88
import pkgutil
9+
import re
10+
import subprocess
911
import sys
1012

1113
from contextlib import redirect_stdout
@@ -16,7 +18,16 @@
1618

1719
from mesonpy import _editable
1820

19-
from .test_wheel import EXT_SUFFIX
21+
from .test_wheel import EXT_SUFFIX, NOGIL_BUILD
22+
23+
24+
def find_cython_version():
25+
cython_version_str = subprocess.run(['cython', '--version'], check=True,
26+
stdout=subprocess.PIPE, text=True).stdout
27+
version_str = re.search(r'(\d{1,4}\.\d{1,4}\.?\d{0,4})', cython_version_str).group(0)
28+
return tuple(map(int, version_str.split('.')))
29+
30+
CYTHON_VERSION = find_cython_version()
2031

2132

2233
def test_walk(package_complex):
@@ -280,6 +291,8 @@ def test_editable_rebuild(package_purelib_and_platlib, tmp_path, verbose, args):
280291
sys.modules.pop('pure', None)
281292

282293

294+
@pytest.mark.skipif(NOGIL_BUILD and CYTHON_VERSION < (3, 1, 0),
295+
reason='Cython version too old, no free-threaded CPython support')
283296
def test_editable_verbose(venv, package_complex, editable_complex, monkeypatch):
284297
monkeypatch.setenv('MESONPY_EDITABLE_VERBOSE', '1')
285298
venv.pip('install', os.fspath(editable_complex))

0 commit comments

Comments
 (0)