Commit 615d6d09 by Eric Coissac

Postpone the Cython import during the installation

parent cc6ac2ee
def build_ext(*args,**kargs):
'''
Wrapper over the build_ext class to postpone the import of cython
'''
from build_ext import build_ext as _build_ext
return _build_ext(*args,**kargs)
......@@ -15,7 +15,7 @@ from distutils.extension import Extension
from obidistutils.command.build import build
from obidistutils.command.littlebigman import littlebigman
from obidistutils.command.build_cexe import build_cexe
from obidistutils.command.build_ext import build_ext
from obidistutils.command import build_ext
from obidistutils.command.build_ctools import build_ctools
from obidistutils.command.build_files import build_files
from obidistutils.command.build_scripts import build_scripts
......@@ -23,11 +23,6 @@ from obidistutils.command.install_scripts import install_scripts
from obidistutils.dist import Distribution
import sys
try:
from Cython.Compiler import Main
has_cython=True
except ImportError:
has_cython=False
def findPackage(root,base=None):
modules=[]
......@@ -43,9 +38,9 @@ def findCython(root,base=None,pyrexs=None):
setupdir = os.path.dirname(sys.argv[0])
pyrexs=[]
#o=dict(Main.default_options)
pyopt=Main.CompilationOptions(Main.default_options)
# pyopt=Main.CompilationOptions(Main.default_options)
#print dir(pyopt)
Main.__dict__['context'] = Main.Context(pyopt.include_path, {})
# Main.__dict__['context'] = Main.Context(pyopt.include_path, {})
if base is None:
base=[]
for module in (path.basename(path.dirname(x))
......@@ -71,7 +66,7 @@ def findCython(root,base=None,pyrexs=None):
pass
pyrexs[-1].sources.extend(glob.glob(os.path.splitext(pyrex)[0]+'.ext.*.c'))
print pyrexs[-1].sources
Main.compile([pyrex],timestamps=True)
# Main.compile([pyrex],timestamps=True)
pyrexs.extend(findCython(path.join(root,module),base+[module]))
return pyrexs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment