# HG changeset patch # User Emmanuel Gil Peyrot # Date 1399806979 -7200 # Node ID a09f6990eab4b7b00173de8cf448a43e424871a5 # Parent 8895ede4e51e61454533727ba3ad4052e20830e9 Add a hack to prevent `setup.py clean` from compiling Cython files. diff -r 8895ede4e51e -r a09f6990eab4 setup.py --- a/setup.py Tue May 06 20:04:10 2014 +0200 +++ b/setup.py Sun May 11 13:16:19 2014 +0200 @@ -28,6 +28,18 @@ use_opengl = True # Compile the OpenGL backend if True nthreads = 4 # How many processes to use for Cython compilation. + +# Hack to prevent `setup.py clean` from compiling Cython files. +if sys.argv[1] == 'clean': + import shutil + shutil.rmtree('build', ignore_errors=True) + for directory, _, files in os.walk('pytouhou'): + for filename in files: + if filename.endswith('.c'): + os.unlink(os.path.join(directory, filename)) + sys.exit(0) + + default_libs = { 'sdl2': '-lSDL2', 'SDL2_image': '-lSDL2_image',