[Python-checkins] distutils2: Add fixup for compiling C in tests with an uninstalled Python (2.7)

eric.araujo python-checkins at python.org
Fri Feb 10 05:11:17 CET 2012


http://hg.python.org/distutils2/rev/9e3c60f3216b
changeset:   1281:9e3c60f3216b
user:        Éric Araujo <merwok at netwok.org>
date:        Thu Feb 09 19:27:01 2012 +0100
summary:
  Add fixup for compiling C in tests with an uninstalled Python (2.7)

files:
  distutils2/tests/support.py |  9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)


diff --git a/distutils2/tests/support.py b/distutils2/tests/support.py
--- a/distutils2/tests/support.py
+++ b/distutils2/tests/support.py
@@ -365,7 +365,9 @@
     need their debug attribute set, and it is not done automatically for
     some reason.
 
-    This function handles both of these things.  Example use:
+    This function handles both of these things, and also fixes
+    cmd.distribution.include_dirs if the running Python is an uninstalled
+    build.  Example use:
 
         cmd = build_ext(dist)
         support.fixup_build_ext(cmd)
@@ -388,6 +390,11 @@
                 name, equals, value = runshared.partition('=')
                 cmd.library_dirs = value.split(os.pathsep)
 
+    # Allow tests to run with an uninstalled Python
+    if sysconfig.is_python_build():
+        pysrcdir = sysconfig.get_config_var('projectbase')
+        cmd.distribution.include_dirs.append(os.path.join(pysrcdir, 'Include'))
+
 
 try:
     from test.test_support import skip_unless_symlink

-- 
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list