Don't use hacks, just cythonize. --- a/setup.py +++ b/setup.py @@ -22,9 +22,7 @@ except ImportError: import os, sys -if '--cythonize' in sys.argv: - # Remove the special argument, otherwise setuptools will raise an exception - sys.argv.remove('--cythonize') +if True: try: # If Cython is installed, transpile the optimized Cython module to C and compile as a .pyd to be distributed from Cython.Build import cythonize, build_ext # this acts as a check whether Cython is installed, otherwise this will fail