summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorAndrew Nelson <andyfaff@gmail.com>2023-01-21 02:03:28 +1100
committerGitHub <noreply@github.com>2023-01-20 16:03:28 +0100
commitdf3751b03d789ee04cac3a9a8a7f7f3aba58735c (patch)
tree515f9f45acb6114f398782744437ec891ee12fc4 /numpy
parent707c3bffc32d170d9953996ee40c54988a8aac98 (diff)
downloadnumpy-df3751b03d789ee04cac3a9a8a7f7f3aba58735c.tar.gz
CI: musllinux_x86_64 (#22864)
[ci skip]
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_mem_policy.py3
-rw-r--r--numpy/core/tests/test_umath.py7
-rw-r--r--numpy/testing/_private/utils.py16
3 files changed, 23 insertions, 3 deletions
diff --git a/numpy/core/tests/test_mem_policy.py b/numpy/core/tests/test_mem_policy.py
index d5dfbc38b..79abdbf1e 100644
--- a/numpy/core/tests/test_mem_policy.py
+++ b/numpy/core/tests/test_mem_policy.py
@@ -5,7 +5,7 @@ import pytest
import numpy as np
import threading
import warnings
-from numpy.testing import extbuild, assert_warns, IS_WASM
+from numpy.testing import extbuild, assert_warns, IS_WASM, IS_MUSL
import sys
@@ -358,6 +358,7 @@ def test_thread_locality(get_module):
assert np.core.multiarray.get_handler_name() == orig_policy_name
+@pytest.mark.xfail(IS_MUSL, reason="gh23050")
@pytest.mark.slow
def test_new_policy(get_module):
a = np.arange(10)
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index 65c0310da..a019b6be3 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -17,7 +17,7 @@ from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex,
assert_array_equal, assert_almost_equal, assert_array_almost_equal,
assert_array_max_ulp, assert_allclose, assert_no_warnings, suppress_warnings,
- _gen_alignment_data, assert_array_almost_equal_nulp, IS_WASM
+ _gen_alignment_data, assert_array_almost_equal_nulp, IS_WASM, IS_MUSL
)
from numpy.testing._private.utils import _glibc_older_than
@@ -1747,6 +1747,7 @@ class TestLDExp:
class TestFRExp:
@pytest.mark.parametrize("stride", [-4,-2,-1,1,2,4])
@pytest.mark.parametrize("dtype", ['f', 'd'])
+ @pytest.mark.xfail(IS_MUSL, reason="gh23048")
@pytest.mark.skipif(not sys.platform.startswith('linux'),
reason="np.frexp gives different answers for NAN/INF on windows and linux")
def test_frexp(self, dtype, stride):
@@ -3855,6 +3856,7 @@ class TestComplexFunctions:
assert_almost_equal(fz.real, fr, err_msg='real part %s' % f)
assert_almost_equal(fz.imag, 0., err_msg='imag part %s' % f)
+ @pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_precisions_consistent(self):
z = 1 + 1j
@@ -3865,6 +3867,7 @@ class TestComplexFunctions:
assert_almost_equal(fcf, fcd, decimal=6, err_msg='fch-fcd %s' % f)
assert_almost_equal(fcl, fcd, decimal=15, err_msg='fch-fcl %s' % f)
+ @pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_branch_cuts(self):
# check branch cuts and continuity on them
@@ -3891,6 +3894,7 @@ class TestComplexFunctions:
_check_branch_cut(np.arccosh, [0-2j, 2j, 2], [1, 1, 1j], 1, 1)
_check_branch_cut(np.arctanh, [0-2j, 2j, 0], [1, 1, 1j], 1, 1)
+ @pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_branch_cuts_complex64(self):
# check branch cuts and continuity on them
@@ -3936,6 +3940,7 @@ class TestComplexFunctions:
b = cfunc(p)
assert_(abs(a - b) < atol, "%s %s: %s; cmath: %s" % (fname, p, a, b))
+ @pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
@pytest.mark.parametrize('dtype', [np.complex64, np.complex_, np.longcomplex])
def test_loss_of_precision(self, dtype):
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index 351bd2a81..44092f185 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -16,6 +16,7 @@ from tempfile import mkdtemp, mkstemp
from unittest.case import SkipTest
from warnings import WarningMessage
import pprint
+import sysconfig
import numpy as np
from numpy.core import(
@@ -36,7 +37,7 @@ __all__ = [
'SkipTest', 'KnownFailureException', 'temppath', 'tempdir', 'IS_PYPY',
'HAS_REFCOUNT', "IS_WASM", 'suppress_warnings', 'assert_array_compare',
'assert_no_gc_cycles', 'break_cycles', 'HAS_LAPACK64', 'IS_PYSTON',
- '_OLD_PROMOTION'
+ '_OLD_PROMOTION', 'IS_MUSL'
]
@@ -56,6 +57,19 @@ HAS_LAPACK64 = numpy.linalg.lapack_lite._ilp64
_OLD_PROMOTION = lambda: np._get_promotion_state() == 'legacy'
+IS_MUSL = False
+try:
+ from packaging.tags import sys_tags
+ _tags = list(sys_tags())
+ if 'musllinux' in _tags[0].platform:
+ IS_MUSL = True
+except ImportError:
+ # fallback to sysconfig (might be flaky)
+ # value could be None.
+ v = sysconfig.get_config_var('HOST_GNU_TYPE') or ''
+ if 'musl' in v:
+ IS_MUSL = True
+
def assert_(val, msg=''):
"""