8000 CI: musllinux_x86_64 by andyfaff · Pull Request #22864 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

CI: musllinux_x86_64 #22864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 20, 2023
Merged
Prev Previous commit
Next Next commit
MAINT: np.testing.IS_MUSL
  • Loading branch information
andyfaff committed Jan 19, 2023
commit c6e172baf42bcc39c3d11cd23ef8d4821a488842
14 changes: 13 additions & 1 deletion numpy/testing/_private/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from unittest.case import SkipTest
from warnings import WarningMessage
import pprint
import sysconfig

import numpy as np
from numpy.core import(
Expand All @@ -36,7 +37,7 @@
'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'
]


Expand All @@ -56,6 +57,17 @@ class KnownFailureException(Exception):

_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)
if 'musl' in sysconfig.get_config_var('HOST_GNU_TYPE'):
IS_MUSL = True


def import_nose():
""" Import nose only when needed.
Expand Down
16 changes: 10 additions & 6 deletions tools/openblas_support.py
8861
Original file line number Diff line numberDiff line change
Expand Up @@ -72,17 +72,21 @@ def get_musllinux(arch):
def get_linux(arch):
# best way of figuring out whether manylinux or musllinux is to look
# at the packaging tags. If packaging isn't installed (it's not by default)
# fallback to assuming it's manylinux
# fallback to sysconfig (which may be flakier)
try:
from packaging.tags import sys_tags

tags = list(sys_tags())
if 'manylinux' in tags[0].platform:
return get_manylinux(arch)
elif 'musllinux' in tags[0].platform:
return get_musllinux(arch)
plat = tags[0].platform
except ImportError:
# fallback to sysconfig for figuring out if you're using musl
plat = 'manylinux'
if 'musl' in sysconfig.get_config_var('HOST_GNU_TYPE'):
plat = 'musllinux'

if 'manylinux' in plat:
return get_manylinux(arch)
elif 'musllinux' in plat:
return get_musllinux(arch)


def download_openblas(target, plat, ilp64):
Expand Down
0