diff options
| author | Naoki INADA <inada-n@koala> | 2010-01-25 20:52:48 +0900 |
|---|---|---|
| committer | Naoki INADA <inada-n@koala> | 2010-01-25 20:52:48 +0900 |
| commit | e02d20dd747ce70e5e0de71bce244bd86666c6f0 (patch) | |
| tree | dff63a45dd55498e641115b71238495a5883d6c4 /python/setup.py | |
| parent | 1a11608f1f5ed4f9ae6dd302b31327145529bf38 (diff) | |
| download | msgpack-python-e02d20dd747ce70e5e0de71bce244bd86666c6f0.tar.gz | |
replace setup by setup_dev.
Diffstat (limited to 'python/setup.py')
| -rwxr-xr-x | python/setup.py | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/python/setup.py b/python/setup.py index c48be14..66cf27e 100755 --- a/python/setup.py +++ b/python/setup.py @@ -1,16 +1,41 @@ #!/usr/bin/env python # coding: utf-8 -from distutils.core import setup, Extension -#from Cython.Distutils import build_ext import os +from glob import glob +from distutils.core import setup, Extension +from distutils.command.sdist import sdist + +try: + from Cython.Distutils import build_ext + import Cython.Compiler.Main as cython_compiler + have_cython = True +except ImportError: + from distutils.command.build_ext import build_ext + have_cython = False version = '0.2.0dev' +# take care of extension modules. +if have_cython: + sources = ['msgpack/_msgpack.pyx'] + + class Sdist(sdist): + def __init__(self, *args, **kwargs): + for src in glob('msgpack/*.pyx'): + cython_compiler.compile(glob('msgpack/*.pyx'), + cython_compiler.default_options) + sdist.__init__(self, *args, **kwargs) +else: + sources = ['msgpack/_msgpack.c'] + + Sdist = sdist + msgpack_mod = Extension('msgpack._msgpack', - #sources=['msgpack/_msgpack.pyx'] - sources=['msgpack/_msgpack.c'] + sources=sources, ) +del sources + desc = 'MessagePack (de)serializer.' long_desc = desc + """ @@ -26,14 +51,15 @@ What's MessagePack? (from http://msgpack.sourceforge.jp/) """ setup(name='msgpack', - author='Naoki INADA', + author='INADA Naoki', author_email='songofacandy@gmail.com', version=version, - #cmdclass={'build_ext': build_ext}, + cmdclass={'build_ext': build_ext, 'sdist': Sdist}, ext_modules=[msgpack_mod], packages=['msgpack'], description=desc, long_description=long_desc, + url="http://msgpack.sourceforge.jp/", classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', |
