Fix setuptools Cython issue

This commit is contained in:
Jonas Borgström 2011-11-05 21:13:15 +01:00
parent be8a14bd7e
commit 6ffa7e851c
4 changed files with 19 additions and 3 deletions

View File

@ -0,0 +1 @@
# This is a python package

View File

@ -0,0 +1,6 @@
from distutils.command.build_ext import build_ext
#
#def build_ext(*args, **kw):
# from distutils import build_ext as build_ext_orig
# return build_ext_orig(*args, **kw)

View File

@ -0,0 +1 @@
# This is a python package

View File

@ -3,6 +3,13 @@
import os
import sys
from glob import glob
try:
import Cython
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex"))
except ImportError:
pass
from setuptools import setup, Extension
from setuptools.command.sdist import sdist
hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c']
@ -18,9 +25,10 @@ def __init__(self, *args, **kwargs):
cython_compiler.default_options)
sdist.__init__(self, *args, **kwargs)
def run(self):
sdist.run(self)
self.filelist.append('darc/hashindex.c', 'darc/hashindex.h')
def make_distribution(self):
self.filelist.append('darc/hashindex.c')
self.filelist.append('darc/hashindex.h')
sdist.make_distribution(self)
except ImportError:
hashindex_sources[0] = hashindex_sources[0].replace('.pyx', '.c')