Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit cb16b91

Browse files
author
Matthias Koeppe
committed
sage_setup.sage_build_cython: Do not fail if cython_aliases, sage_include_directories cannot be imported
1 parent f04ea03 commit cb16b91

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/sage_setup/command/sage_build_cython.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
from sage_setup.find import find_extra_files
1919
from sage_setup.library_order import library_order
2020

21-
from sage.env import (cython_aliases, sage_include_directories)
22-
2321
# Do not put all, but only the most common libraries and their headers
2422
# (that are likely to change on an upgrade) here:
2523
# [At least at the moment. Make sure the headers aren't copied with "-p",
@@ -57,8 +55,13 @@
5755
if subprocess.call("""$CC --version | grep -i 'gcc.* 4[.]8' >/dev/null """, shell=True) == 0:
5856
extra_compile_args.append('-fno-tree-copyrename')
5957

60-
# Search for dependencies in the source tree and add to the list of include directories
61-
include_dirs = sage_include_directories(use_sources=True)
58+
try:
59+
from sage.env import (cython_aliases, sage_include_directories)
60+
# Search for dependencies in the source tree and add to the list of include directories
61+
include_dirs = sage_include_directories(use_sources=True)
62+
except ModuleNotFoundError:
63+
cython_aliases = {}
64+
sage_include_directories = []
6265

6366
# Look for libraries only in what is configured already through distutils
6467
# and environment variables

0 commit comments

Comments
 (0)