module_list.append(Extension(name=name, sources=[file], **deps.distutils_info(file).values))
return module_list
+cython_py = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../cython.py'))
+
def cythonize(module_list, ctx=None):
deps = create_dependency_tree(ctx)
to_compile = []
m.sources = new_sources
to_compile.sort()
# TODO: invoke directly
- cython_py = os.path.join(os.path.dirname(__file__), '../../cython.py')
for priority, pyx_file, c_file in to_compile:
cmd = "%s %s %s -o %s" % (sys.executable, cython_py, pyx_file, c_file)
print cmd
This is a test of build/*.srctree files, where srctree defines a full
directory structure and its header gives a list of commands to run.
"""
+ cython_root = os.path.dirname(os.path.abspath(__file__))
+
def __init__(self, treefile, workdir, cleanup_workdir=True):
self.treefile = treefile
self.workdir = os.path.join(workdir, os.path.splitext(treefile)[0])
os.chdir(self.old_dir)
def runTest(self):
- # Assumes old_dir is root of the cython directory...
commands = (self.commands
- .replace("CYTHON", "PYTHON %s" % os.path.join(self.old_dir, 'cython.py'))
+ .replace("CYTHON", "PYTHON %s" % os.path.join(self.cython_root, 'cython.py'))
.replace("PYTHON", sys.executable))
commands = """
PYTHONPATH="%s%s$PYTHONPATH"
%s
- """ % (self.old_dir, os.pathsep, commands)
+ """ % (self.cython_root, os.pathsep, commands)
self.assertEqual(0, os.system(commands))