diff options
author | ?ric Araujo <merwok@netwok.org> | 2012-02-09 19:27:01 +0100 |
---|---|---|
committer | ?ric Araujo <merwok@netwok.org> | 2012-02-09 19:27:01 +0100 |
commit | 95256a04b9d2d83e0c6a08a5afaffd07a6978272 (patch) | |
tree | 3ad6cc94bf7d398e52c418a6ece947b9a5d7f3ac | |
parent | b826adf03b65157802aefe2ae67ac0e4c93efe10 (diff) | |
download | disutils2-95256a04b9d2d83e0c6a08a5afaffd07a6978272.tar.gz |
Add fixup for compiling C in tests with an uninstalled Python (2.7)
-rw-r--r-- | distutils2/tests/support.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/distutils2/tests/support.py b/distutils2/tests/support.py index b0f6cc8..4852c54 100644 --- a/distutils2/tests/support.py +++ b/distutils2/tests/support.py @@ -365,7 +365,9 @@ def fixup_build_ext(cmd): 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 @@ def fixup_build_ext(cmd): 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 |