Commit 92bdeb20 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix cython path.

parent 2fa4df3b
......@@ -334,6 +334,8 @@ def create_extension_list(filepatterns, ctx=None):
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 = []
......@@ -365,7 +367,6 @@ def cythonize(module_list, ctx=None):
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
......
......@@ -634,6 +634,8 @@ class EndToEndTest(unittest.TestCase):
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])
......@@ -657,14 +659,13 @@ class EndToEndTest(unittest.TestCase):
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))
......
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