From fb965ece366c9d67cfb99354c855f258267d600b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Jul 2022 16:21:53 -0700 Subject: [PATCH] sage.env.sage_include_directories: Append sysconfig variable INCLUDEPY --- src/sage/env.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 1dcc046ccab..2213a1a8459 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -375,14 +375,20 @@ def sage_include_directories(use_sources=False): sage: any(os.path.isfile(os.path.join(d, file)) for d in dirs) True """ - TOP = SAGE_SRC if use_sources else SAGE_LIB - - dirs = [TOP] + if use_sources: + dirs = [SAGE_SRC] + else: + import sage + dirs = [os.path.dirname(directory) + for directory in sage.__path__] try: import numpy - dirs.insert(1, numpy.get_include()) + dirs.append(numpy.get_include()) except ModuleNotFoundError: pass + + dirs.append(sysconfig.get_config_var('INCLUDEPY')) + return dirs def get_cblas_pc_module_name() -> str: