summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-02-16 16:00:23 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-02-16 16:00:23 +0000
commitd4e6b29c2de74962fb1c5d4b6160f392b1213c6d (patch)
treebefdab3a981b28b7b04b455672d35be9dc991a99
parenta920e0ab5d7bcbaf7878eed7584091e9268aa95f (diff)
fix build when generated .c file already exists.
SVN revision: 46213
-rw-r--r--setup.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 3545935..ab99cfe 100644
--- a/setup.py
+++ b/setup.py
@@ -1,19 +1,24 @@
1import sys 1import sys
2import os 2import os
3 3
4if not os.path.exists("ethumb/ethumb.c_ethumb.c"): 4try:
5 try: 5 from Cython.Distutils import build_ext
6 from Cython.Distutils import build_ext 6 # work around stupid setuptools that insists on just checking pyrex
7 # work around stupid setuptools that insists on just checking pyrex 7 sys.modules['Pyrex'] = sys.modules['Cython']
8 sys.modules['Pyrex'] = sys.modules['Cython'] 8 have_cython = True
9 except ImportError: 9except ImportError:
10 raise SystemExit("You need Cython -- http://cython.org/") 10 have_cython = False
11else: 11
12 from distutils.command.build_ext import build_ext 12if not have_cython and not os.path.exists("ethumb/ethumb.c_ethumb.c"):
13 raise SystemExit("You need Cython -- http://cython.org/")
13 14
14from ez_setup import use_setuptools 15from ez_setup import use_setuptools
15use_setuptools('0.6c9') 16use_setuptools('0.6c9')
16 17
18if not have_cython:
19 print "No cython installed, using existing generated C files."
20 from setuptools.command.build_ext import build_ext
21
17from setuptools import setup, find_packages, Extension 22from setuptools import setup, find_packages, Extension
18import subprocess 23import subprocess
19import shlex 24import shlex