Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.env.sage_include_directories: Don't use distutils and SAGE_LIB #35118

Merged
merged 3 commits into from
Mar 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,20 @@ def sage_include_directories(use_sources=False):
sage: any(os.path.isfile(os.path.join(d, file)) for d in dirs)
True
"""
import distutils.sysconfig

TOP = SAGE_SRC if use_sources else SAGE_LIB

dirs = [TOP,
distutils.sysconfig.get_python_inc()]
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:
Expand Down