From: Robert Bradshaw Date: Sun, 12 Sep 2010 09:08:52 +0000 (-0700) Subject: Fix cython path. X-Git-Tag: 0.14.alpha0~317 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=92bdeb2060419bb219a285476b2fba19034a502f;p=cython.git Fix cython path. --- diff --git a/Cython/Compiler/Dependencies.py b/Cython/Compiler/Dependencies.py index 4772bda2..086dbdc4 100644 --- a/Cython/Compiler/Dependencies.py +++ b/Cython/Compiler/Dependencies.py @@ -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 diff --git a/runtests.py b/runtests.py index 3c2d392b..89d22793 100644 --- a/runtests.py +++ b/runtests.py @@ -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))