From c2dd659f60e2e4698160876b6540d5698525b97d Mon Sep 17 00:00:00 2001 From: Elliot Cameron <130508846+de11n@users.noreply.github.com> Date: Fri, 28 Jul 2023 15:10:24 -0400 Subject: [PATCH] Fix setup.py to respect numpy's parsing of libraries in site.cfg numpy parses libraries in site.cfg by splitting on comma. We want to maintain compatibility with that, but we've already established os.pathname by accident. To minimize breakages, we support both. --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a68ebad..a6edb06 100644 --- a/setup.py +++ b/setup.py @@ -71,8 +71,10 @@ def parse_site_cfg(): site['mkl']['include_dirs'].split(os.pathsep)) lib_dirs.extend( site['mkl']['library_dirs'].split(os.pathsep)) + # numpy's site.cfg splits libraries by comma, but numexpr historically split by os.pathsep. + # For compatibility, we split by both. libs.extend( - site['mkl']['libraries'].split(os.pathsep)) + site['mkl']['libraries'].replace(os.pathsep, ',').split(',')) def_macros.append(('USE_VML', None)) print(f'FOUND MKL IMPORT')