Skip to content

Commit 79807da

Browse files
authored
Merge pull request pygame#4352 from pygame/cython_only
setup: Fix cython_only command
2 parents e32de35 + 76ab501 commit 79807da

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Diff for: setup.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ def consume_arg(name):
237237
compile_cython = True
238238
cython_only = True
239239

240-
# If there is no generated C code, compile the cython/.pyx files
241-
if any(x in ["build_ext", "build", "sdist", "bdist_wheel", "install"] for x in sys.argv) and (
242-
not glob.glob(os.path.join("src_c", "_sdl2", "audio.c"))
243-
or not glob.glob(os.path.join("src_c", "pypm.c"))
244-
):
245-
compile_cython = True
246-
print ("Compiling Cython files")
247-
else:
248-
print ("Skipping Cython compilation")
240+
if not cython_only:
241+
# If there is no generated C code, compile the cython/.pyx files
242+
if any(x in ["build_ext", "build", "sdist", "bdist_wheel", "install"] for x in sys.argv) and (
243+
not glob.glob(os.path.join("src_c", "_sdl2", "audio.c"))
244+
or not glob.glob(os.path.join("src_c", "pypm.c"))
245+
):
246+
compile_cython = True
247+
else:
248+
print ("Skipping Cython compilation")
249249

250250
if compile_cython:
251251
if "setup_requires" not in METADATA:
@@ -254,6 +254,7 @@ def consume_arg(name):
254254
METADATA["setup_requires"].append('cython>=3.0')
255255

256256
if compile_cython:
257+
print ("Compiling Cython files")
257258
# compile .pyx files
258259
# So you can `setup.py cython` or `setup.py cython install`
259260
try:

0 commit comments

Comments
 (0)