Skip to content
Browse files

allow --without-cython to override build error (needed for non-build …

…setup.py targets)
  • Loading branch information...
1 parent e246ba5 commit 6478b2f6d1ce37c64384813ee07a68d6b094d138 @scoder scoder committed Oct 7, 2012
Showing with 14 additions and 5 deletions.
  1. +4 −1 CHANGES.txt
  2. +1 −1 Makefile
  3. +9 −3 setupinfo.py
View
5 CHANGES.txt
@@ -19,7 +19,10 @@ Other changes
-------------
* The build no longer uses Cython by default unless the generated C files
- are missing. To use Cython, pass the option "--with-cython".
+ are missing. To use Cython, pass the option "--with-cython". To ignore
+ the fatal build error when Cython is required but not available (e.g. to
+ run special setup.py commands that do not actually run a build), pass
+ "--without-cython".
3.0beta1 (2012-09-26)
View
2 Makefile
@@ -116,4 +116,4 @@ docclean:
realclean: clean docclean
find . -name '*.c' -exec rm -f {} \;
rm -f TAGS
- $(PYTHON) setup.py clean -a
+ $(PYTHON) setup.py clean -a --without-cython
View
12 setupinfo.py
@@ -70,13 +70,19 @@ def ext_modules(static_include_dirs, static_library_dirs,
# generate module cleanup code
from Cython.Compiler import Options
Options.generate_cleanup_code = 3
- elif False in c_files_exist:
+ elif not OPTION_WITHOUT_CYTHON and False in c_files_exist:
for exists, module in zip(c_files_exist, modules):
if not exists:
raise RuntimeError(
- "ERROR: Trying to build without Cython, but pre-generated "
- "'%s%s.c' is not available." % (PACKAGE_PATH, module))
+ "ERROR: Trying to build without Cython, but pre-generated '%s%s.c' "
+ "is not available (pass --without-cython to ignore this error)." % (
+ PACKAGE_PATH, module))
else:
+ if False in c_files_exist:
+ for exists, module in zip(c_files_exist, modules):
+ if not exists:
+ print("WARNING: Trying to build without Cython, but pre-generated "
+ "'%s%s.c' is not available." % (PACKAGE_PATH, module))
source_extension = ".c"
print("Building without Cython.")

0 comments on commit 6478b2f

Please sign in to comment.
Something went wrong with that request. Please try again.