Skip to content

Commit

Permalink
Merge pull request numpy#17346 from BvB93/build-fix
Browse files Browse the repository at this point in the history
BLD,BUG: Fix a macOS build failure when `NPY_BLAS_ORDER=""`
  • Loading branch information
mattip authored Sep 18, 2020
2 parents c6853c7 + 6d3a9d7 commit 385575f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions numpy/distutils/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ def _parse_env_order(base_order, env):
allow_order = base_order.copy()

for order in orders:
if not order:
continue

if order not in base_order:
unknown_order.append(order)
continue
Expand All @@ -482,6 +485,9 @@ def _parse_env_order(base_order, env):
allow_order = []

for order in orders:
if not order:
continue

if order not in base_order:
unknown_order.append(order)
continue
Expand Down
8 changes: 7 additions & 1 deletion numpy/distutils/tests/test_system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_overrides(self):
assert info.get_lib_dirs() == lib_dirs
finally:
os.chdir(previousDir)


def test_distutils_parse_env_order(monkeypatch):
from numpy.distutils.system_info import _parse_env_order
Expand All @@ -298,6 +298,12 @@ def test_distutils_parse_env_order(monkeypatch):
assert order == list('bef')
assert len(unknown) == 1

# For when LAPACK/BLAS optimization is disabled
monkeypatch.setenv(env, '')
order, unknown = _parse_env_order(base_order, env)
assert len(order) == 0
assert len(unknown) == 0

for prefix in '^!':
monkeypatch.setenv(env, f'{prefix}b,i,e')
order, unknown = _parse_env_order(base_order, env)
Expand Down

0 comments on commit 385575f

Please sign in to comment.