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 23, 2024
1 parent ceea4c3 commit 90d633e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 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,16 @@

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_str = re.search(r'(\d{1,4}\.\d{1,4}\.?\d{0,4})', 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 +291,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 90d633e

Please sign in to comment.