Skip to content

Commit 24db64d

Browse files
committed
Detect musllinux
1 parent 862aa00 commit 24db64d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/env.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")
1212
FREEBSD = sys.platform.startswith("freebsd")
1313

14+
MUSLLINUX = False
15+
MANYLINUX = False
16+
if LINUX:
17+
18+
def _is_musl() -> bool:
19+
libc, _ = platform.libc_ver()
20+
return libc == "musl" or (libc != "glibc" and libc != "")
21+
22+
MUSLLINUX = _is_musl()
23+
MANYLINUX = not MUSLLINUX
24+
del _is_musl
25+
1426
CPYTHON = platform.python_implementation() == "CPython"
1527
PYPY = platform.python_implementation() == "PyPy"
1628
GRAALPY = sys.implementation.name == "graalpy"

tests/test_multiple_interpreters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ def test_import_in_subinterpreter_before_main():
408408
@pytest.mark.skipif(
409409
sys.platform.startswith("emscripten"), reason="Requires loadable modules"
410410
)
411+
@pytest.mark.xfail(env.MUSLLINUX, reason="Flaky on musllinux", strict=False)
411412
@pytest.mark.skipif(not CONCURRENT_INTERPRETERS_SUPPORT, reason="Requires 3.14.0b3+")
412413
def test_import_in_subinterpreter_concurrently():
413414
"""Tests that importing a module in multiple subinterpreters concurrently works correctly"""

0 commit comments

Comments
 (0)