File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,17 @@ def detect_openmp():
8989 mathlib = [] if os .name == "nt" else ["m" ]
9090
9191 has_openmp = detect_openmp ()
92- # If we are building a source distribution, the c code is already generated
92+
93+
94+ # There are two cases to consider when running setup.py:
95+ # 1. We are building from source, so we need cython to generate the .c files
96+ # from the .pyx files.
97+ # 2. we are building from a source distribution (sdist), in which case the
98+ # .c files are included and we don't need Cython.
99+ # If we are installing from a wheel, the binary is already built and the
100+ # setup.py is not run at all.
101+ # We can detect a sdist by checking for the presence of a setup.cfg file,
102+ # which is generated by setuptools when building the sdist.
93103 use_cython = not Path ("./setup.cfg" ).exists ()
94104 source_suffix = ".pyx" if use_cython else ".c"
95105
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments