Commit fd4f9c44 authored by Robert Bradshaw's avatar Robert Bradshaw
parents bc3490e5 6f73b428
......@@ -226,6 +226,8 @@ class build_ext(_build_ext.build_ext):
if not self.inplace and (self.pyrex_c_in_temp
or getattr(extension, 'pyrex_c_in_temp', 0)):
target_dir = os.path.join(self.build_temp, "pyrex")
for package_name in extension.name.split('.')[:-1]:
target_dir = os.path.join(target_dir, package_name)
else:
target_dir = None
......
......@@ -112,6 +112,7 @@ def handle_special_build(modname, pyxfilename):
return ext, setup_args
def handle_dependencies(pyxfilename):
testing = '_test_files' in globals()
dependfile = os.path.splitext(pyxfilename)[0] + PYXDEP_EXT
# by default let distutils decide whether to rebuild on its own
......@@ -132,6 +133,7 @@ def handle_dependencies(pyxfilename):
files.extend(glob.glob(fullpath))
# only for unit testing to see we did the right thing
if testing:
_test_files[:] = [] #$pycheck_no
# if any file that the pyxfile depends upon is newer than
......@@ -143,6 +145,7 @@ def handle_dependencies(pyxfilename):
print("Rebuilding because of ", file)
filetime = os.path.getmtime(file)
os.utime(pyxfilename, (filetime, filetime))
if testing:
_test_files.append(file)
def build_module(name, pyxfilename, pyxbuild_dir=None):
......
import pyximport; pyximport.install()
import pyximport; pyximport.install(reload_support=True)
import os, sys
import time, shutil
import tempfile
......@@ -21,6 +21,7 @@ def on_remove_file_error(func, path, excinfo):
print "You may want to delete this yourself when you get a chance."
def test():
pyximport._test_files = []
tempdir = make_tempdir()
sys.path.append(tempdir)
filename = os.path.join(tempdir, "dummy.pyx")
......
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