diff options
author | Andrew Nelson <andyfaff@gmail.com> | 2023-01-21 02:03:28 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-20 16:03:28 +0100 |
commit | df3751b03d789ee04cac3a9a8a7f7f3aba58735c (patch) | |
tree | 515f9f45acb6114f398782744437ec891ee12fc4 /numpy/testing/_private/utils.py | |
parent | 707c3bffc32d170d9953996ee40c54988a8aac98 (diff) | |
download | numpy-df3751b03d789ee04cac3a9a8a7f7f3aba58735c.tar.gz |
CI: musllinux_x86_64 (#22864)
[ci skip]
Diffstat (limited to 'numpy/testing/_private/utils.py')
-rw-r--r-- | numpy/testing/_private/utils.py | 16 |
1 files changed, 15 insertions, 1 deletions
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=''): """ |