Skip to content

Commit

Permalink
TST: skip test that fails under free-threaded CPython for too old Cython
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rgommers committed Apr 17, 2024
1 parent bc400fe commit b6bd80e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/test_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os
import pathlib
import pkgutil
import re
import subprocess
import sys

from contextlib import redirect_stdout
Expand All @@ -16,7 +18,17 @@

from mesonpy import _editable

from .test_wheel import EXT_SUFFIX
from .test_wheel import EXT_SUFFIX, NOGIL_BUILD


def find_cython_version():
_cython_version_str = subprocess.run(['cython', '--version'], check=True,
stdout=subprocess.PIPE, text=True).stdout
version_regex = re.compile(r"(\d{1,4}\.\d{1,4}\.?\d{0,4})")
version_str = version_regex.search(_cython_version_str).group(0)
return tuple(map(int, version_str.split('.')))

CYTHON_VERSION = find_cython_version()


def test_walk(package_complex):
Expand Down Expand Up @@ -280,6 +292,8 @@ def test_editable_rebuild(package_purelib_and_platlib, tmp_path, verbose, args):
sys.modules.pop('pure', None)


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

0 comments on commit b6bd80e

Please sign in to comment.