summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2023-02-17 20:11:43 +0000
committerGitHub <noreply@github.com>2023-02-17 20:11:43 +0000
commita9395b87873215ec6ca2748e83e710dc130fd859 (patch)
tree30b2acdb3a3c04526b6c91614f9e7adfd441f56a
parent4f742e0f6815deae3368009dff52bc2031f67a82 (diff)
parent1633a49760b0c90f3ea607795f2503cde38c4c80 (diff)
downloadnumpy-a9395b87873215ec6ca2748e83e710dc130fd859.tar.gz
Merge pull request #23233 from ganesh-k13/config_raw_str
BUG: Use raw strings for paths `__config__.py.in`
-rw-r--r--numpy/__config__.py.in34
1 files changed, 14 insertions, 20 deletions
diff --git a/numpy/__config__.py.in b/numpy/__config__.py.in
index 659a09b26..6c6c21cb8 100644
--- a/numpy/__config__.py.in
+++ b/numpy/__config__.py.in
@@ -21,10 +21,8 @@ def _cleanup(d):
Removes empty values in a `dict` recursively
This ensures we remove values that Meson could not provide to CONFIG
"""
- if type(d) is dict:
- return dict(
- (k, _cleanup(v)) for k, v in d.items() if v and _cleanup(v)
- )
+ if isinstance(d, dict):
+ return {k: _cleanup(v) for k, v in d.items() if v and _cleanup(v)}
else:
return d
@@ -64,45 +62,41 @@ CONFIG = _cleanup(
"endian": "@BUILD_CPU_ENDIAN@",
"system": "@BUILD_CPU_SYSTEM@",
},
- "cross-compiled": "@CROSS_COMPILED@",
+ "cross-compiled": bool("@CROSS_COMPILED@".lower().replace("false", "")),
},
"Build Dependencies": {
"blas": {
"name": "@BLAS_NAME@",
- "found": "@BLAS_FOUND@",
+ "found": bool("@BLAS_FOUND@".lower().replace("false", "")),
"version": "@BLAS_VERSION@",
"detection method": "@BLAS_TYPE_NAME@",
- "include directory": "@BLAS_INCLUDEDIR@",
- "lib directory": "@BLAS_LIBDIR@",
+ "include directory": r"@BLAS_INCLUDEDIR@",
+ "lib directory": r"@BLAS_LIBDIR@",
"openblas configuration": "@BLAS_OPENBLAS_CONFIG@",
- "pc file directory": "@BLAS_PCFILEDIR@",
+ "pc file directory": r"@BLAS_PCFILEDIR@",
},
"lapack": {
"name": "@LAPACK_NAME@",
- "found": "@LAPACK_FOUND@",
+ "found": bool("@LAPACK_FOUND@".lower().replace("false", "")),
"version": "@LAPACK_VERSION@",
"detection method": "@LAPACK_TYPE_NAME@",
- "include directory": "@LAPACK_INCLUDEDIR@",
- "lib directory": "@LAPACK_LIBDIR@",
+ "include directory": r"@LAPACK_INCLUDEDIR@",
+ "lib directory": r"@LAPACK_LIBDIR@",
"openblas configuration": "@LAPACK_OPENBLAS_CONFIG@",
- "pc file directory": "@LAPACK_PCFILEDIR@",
+ "pc file directory": r"@LAPACK_PCFILEDIR@",
},
},
"Python Information": {
- "path": "@PYTHON_PATH@",
+ "path": r"@PYTHON_PATH@",
"version": "@PYTHON_VERSION@",
},
"SIMD Extensions": {
"baseline": __cpu_baseline__,
"found": [
- feature
- for feature in __cpu_dispatch__
- if __cpu_features__[feature]
+ feature for feature in __cpu_dispatch__ if __cpu_features__[feature]
],
"not found": [
- feature
- for feature in __cpu_dispatch__
- if not __cpu_features__[feature]
+ feature for feature in __cpu_dispatch__ if not __cpu_features__[feature]
],
},
}