Skip to content

Commit 30009fa

Browse files
author
Matthias Koeppe
committed
src/setup.py: More detailed logging around cythonizing
1 parent 6e50ba9 commit 30009fa

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/setup.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@
8585
from sage_setup.autogen import autogen_all
8686
autogen_all()
8787

88-
log.info("Discovering Python/Cython source code....")
89-
t = time.time()
88+
log.info("Discovering Python/Cython source code...")
9089

9190
# Exclude a few files if the corresponding distribution is not loaded
9291
optional_packages = ['mcqd', 'bliss', 'tdlib',
@@ -103,13 +102,19 @@
103102
python_packages = find_namespace_packages(where=SAGE_SRC, include=['sage', 'sage.*'])
104103
log.debug(f"python_packages = {python_packages}")
105104

106-
log.info(f"Discovered Python/Cython sources, time: {(time.time() - t):.2f} seconds.")
105+
log.info(f"Discovering Python/Cython source code... done")
107106

108107
# from sage_build_cython:
109108
import Cython.Compiler.Options
110109
Cython.Compiler.Options.embed_pos_in_docstring = True
111110
gdb_debug = os.environ.get('SAGE_DEBUG', None) != 'no'
112111

112+
aliases = cython_aliases()
113+
log.debug(f"aliases = {aliases}")
114+
include_path = sage_include_directories(use_sources=True) + ['.']
115+
log.debug(f"include_path = {include_path}")
116+
nthreads = sage_build_ext_minimal.get_default_number_build_jobs()
117+
log.info(f"Cythonizing with {nthreads} threads...")
113118
try:
114119
from Cython.Build import cythonize
115120
from sage.env import cython_aliases, sage_include_directories
@@ -118,16 +123,17 @@
118123
extensions = cythonize(
119124
["sage/**/*.pyx"],
120125
exclude=files_to_exclude,
121-
include_path=sage_include_directories(use_sources=True) + ['.'],
126+
include_path=include_path,
122127
compile_time_env=compile_time_env_variables(),
123128
compiler_directives=compiler_directives(False),
124-
aliases=cython_aliases(),
129+
aliases=aliases,
125130
create_extension=create_extension,
126131
gdb_debug=gdb_debug,
127-
nthreads=sage_build_ext_minimal.get_default_number_build_jobs())
132+
nthreads=nthreads)
128133
except Exception as exception:
129134
log.warn(f"Exception while cythonizing source files: {repr(exception)}")
130135
raise
136+
log.info(f"Cythonizing with {nthreads} threads... done")
131137

132138
# ########################################################
133139
# ## Distutils

0 commit comments

Comments
 (0)