Skip to content

Commit

Permalink
Use distribute_setup.py to help get pip working (and to ensure the co…
Browse files Browse the repository at this point in the history
…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
Sam Rushing committed Apr 13, 2012
1 parent ade5e6c commit a9bb5e3
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions setup.py
@@ -1,16 +1,26 @@
# $Header: //prod/main/ap/shrapnel/setup.py#17 $ # $Header: //prod/main/ap/shrapnel/setup.py#17 $
#!/usr/bin/env python #!/usr/bin/env python


from distutils.core import setup import sys
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 glob import glob
import os 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() include_dir = os.getcwd()


def newer(x, y): def newer(x, y):
Expand Down Expand Up @@ -106,6 +116,6 @@ def check_lio():
}, },
py_modules = ['backdoor', 'coro_process', 'coro_unittest'], py_modules = ['backdoor', 'coro_process', 'coro_unittest'],
download_url = 'http://github.com/ironport/shrapnel/tarball/master#egg=coro-1.0.1', 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}, cmdclass={'build_ext': build_ext},
) )

0 comments on commit a9bb5e3

Please sign in to comment.