From 1faf54304c1bcaa635e43d4f32c84fc035615f8e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 29 Jun 2024 20:36:48 -0700 Subject: [PATCH] setup.py: Do not cythonize on sdist --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 11b29f5..39be067 100755 --- a/setup.py +++ b/setup.py @@ -61,6 +61,11 @@ def readfile(filename): 'HAVE_ADD_COL_UNTYPED_ARGS': True} print("Using compile_time_env: {}".format(compile_time_env), file=sys.stderr) +if any(x in sys.argv + for x in ['build', 'build_ext', 'bdist_wheel', 'install']): + ext_modules = cythonize(ext_modules, include_path=sys.path, + compile_time_env=compile_time_env), + setup( name="sage_numerical_backends_coin", version=readfile("VERSION").strip(), @@ -87,8 +92,7 @@ def readfile(filename): 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', ], - ext_modules = cythonize(ext_modules, include_path=sys.path, - compile_time_env=compile_time_env), + ext_modules=ext_modules, cmdclass = {'test': SageTest, 'check_sage_testsuite': SageTestSage}, # adding a special setup command for tests keywords=['milp', 'linear-programming', 'optimization'], packages=['sage_numerical_backends_coin'],