Permalink
Browse files

Use distribute_setup.py to help get pip working (and to ensure the co…

…rrect version of distribute is present). Distribute>=0.6.16 is required to invoke Cython automatically.

Check for Cython's presence manually: unfortunately the install_requires param to setup will never be seen if Cython is not present (due to the use of Cython's Extension module)
  • Loading branch information...
1 parent ade5e6c commit a9bb5e34335d63b25c3542c85f04ba3576f1d7b4 Sam Rushing committed Apr 13, 2012
Showing with 18 additions and 8 deletions.
  1. +18 −8 setup.py
View
@@ -1,16 +1,26 @@
# $Header: //prod/main/ap/shrapnel/setup.py#17 $
#!/usr/bin/env python
-from distutils.core import setup
-from Cython.Distutils import build_ext
-from Cython.Distutils.extension import Extension
-
-#from Cython.Distutils import build_ext
-#from Cython.Distutils.extension import Extension
-
+import sys
import glob
import os
+from distribute_setup import use_setuptools
+use_setuptools()
+from setuptools import setup
+
+try:
+ from Cython.Distutils import build_ext
+ from Cython.Distutils.extension import Extension
+except ImportError:
+ sys.stderr.write (
+ '\nThe Cython compiler is required to build Shrapnel.\n'
+ ' Try "pip install cython"\n'
+ ' *or* "easy_install cython"\n'
+ )
+ sys.exit (-1)
+
+
include_dir = os.getcwd()
def newer(x, y):
@@ -106,6 +116,6 @@ def check_lio():
},
py_modules = ['backdoor', 'coro_process', 'coro_unittest'],
download_url = 'http://github.com/ironport/shrapnel/tarball/master#egg=coro-1.0.1',
- install_requires = ['cython>=0.12.1', 'distribute>=0.6.16'],
+ install_requires = ['Cython>=0.12.1', 'distribute>=0.6.16'],
cmdclass={'build_ext': build_ext},
)

0 comments on commit a9bb5e3

Please sign in to comment.