663f010f08
- Enable openblas for python-numpy:gnu-hpc on s390x - Add patch fix-meson-multiple-python-versions.patch: * Ensure meson executes sys.executable when testing Cython. - Update to 1.26.4 * NumPy 1.26.4 is a maintenance release that fixes bugs and regressions discovered after the 1.26.3 release. The Python versions supported by this release are 3.9-3.12. This is the last planned release in the 1.26.x series. * BUG: Restore missing asstr import * MAINT: prepare 1.26.x for further development * BUG: numpy.array_api: fix linalg.cholesky upper decomp... * MAINT, BLD: Fix unused inline functions warnings on clang * TST: Fix test_numeric on riscv64 * MAINT: add newaxis to __all__ in numpy.array_api * BUG: Use large file fallocate on 32 bit linux platforms * TST: Fix test_warning_calls on Python 3.12 * TST: Bump pytz to 2023.3.post1 * BUG: Fix AVX512 build flags on Intel Classic Compiler * BLD: fix potential issue with escape sequences in __config__.py * BLD: unvendor meson-python on 1.26.x and upgrade to meson-python... * MAINT: Include header defining backtrace * BUG: Fix np.quantile([Fraction(2,1)], 0.5) (#24711) - Release 1.26.3 ## Compatibility * f2py will no longer accept ambiguous -m and .pyf CLI OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy1?expand=0&rev=1
65 lines
2.5 KiB
Diff
65 lines
2.5 KiB
Diff
From bf50761dee8f0670542bcdc1fd9bff5cdb0448d4 Mon Sep 17 00:00:00 2001
|
|
From: Fabian Vogt <fvogt@suse.de>
|
|
Date: Thu, 28 Mar 2024 14:39:45 +0100
|
|
Subject: [PATCH] BUG: Fix test_impossible_feature_enable failing without
|
|
BASELINE_FEAT
|
|
|
|
If the build has no baseline features set, the test ended up setting
|
|
e.g. NPY_ENABLE_CPU_FEATURES="ASIMDHP, None". This actually made the
|
|
execution succeed, as the warning for decoding "None" overrode the
|
|
error for the real feature. Fix the error handling there by removing
|
|
the errorneous "return 0;", add a test for this, and avoid passing
|
|
"None" by accident.
|
|
---
|
|
numpy/core/src/common/npy_cpu_features.c | 1 -
|
|
numpy/core/tests/test_cpu_features.py | 14 ++++++++++++--
|
|
2 files changed, 12 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/numpy/core/src/common/npy_cpu_features.c b/numpy/core/src/common/npy_cpu_features.c
|
|
index bd149f8b4..f4d25cc50 100644
|
|
--- a/numpy/core/src/common/npy_cpu_features.c
|
|
+++ b/numpy/core/src/common/npy_cpu_features.c
|
|
@@ -324,7 +324,6 @@ npy__cpu_check_env(int disable, const char *env) {
|
|
) < 0) {
|
|
return -1;
|
|
}
|
|
- return 0;
|
|
}
|
|
|
|
#define NOTSUPP_BODY \
|
|
diff --git a/numpy/core/tests/test_cpu_features.py b/numpy/core/tests/test_cpu_features.py
|
|
index 48ab30a4a..88e4ad185 100644
|
|
--- a/numpy/core/tests/test_cpu_features.py
|
|
+++ b/numpy/core/tests/test_cpu_features.py
|
|
@@ -308,8 +308,8 @@ def test_impossible_feature_enable(self):
|
|
err_type = "RuntimeError"
|
|
self._expect_error(msg, err_type)
|
|
|
|
- # Ensure that only the bad feature gets reported
|
|
- feats = f"{bad_feature}, {self.BASELINE_FEAT}"
|
|
+ # Ensure that it fails even when providing garbage in addition
|
|
+ feats = f"{bad_feature}, Foobar"
|
|
self.env['NPY_ENABLE_CPU_FEATURES'] = feats
|
|
msg = (
|
|
f"You cannot enable CPU features \\({bad_feature}\\), since they "
|
|
@@ -317,6 +317,16 @@ def test_impossible_feature_enable(self):
|
|
)
|
|
self._expect_error(msg, err_type)
|
|
|
|
+ if self.BASELINE_FEAT is not None:
|
|
+ # Ensure that only the bad feature gets reported
|
|
+ feats = f"{bad_feature}, {self.BASELINE_FEAT}"
|
|
+ self.env['NPY_ENABLE_CPU_FEATURES'] = feats
|
|
+ msg = (
|
|
+ f"You cannot enable CPU features \\({bad_feature}\\), since "
|
|
+ "they are not supported by your machine."
|
|
+ )
|
|
+ self._expect_error(msg, err_type)
|
|
+
|
|
is_linux = sys.platform.startswith('linux')
|
|
is_cygwin = sys.platform.startswith('cygwin')
|
|
machine = platform.machine()
|
|
--
|
|
2.44.0
|
|
|