Skip to content

Commit b8a9531

Browse files
committed
Clarify setup.py behaviour
1 parent ea115b2 commit b8a9531

2 files changed

Lines changed: 11 additions & 35 deletions

File tree

setup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/scatterkit/_version.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)