[pypy-commit] pypy default: Fix home and user distutils installation schemes. (issue1272)

carljm noreply at buildbot.pypy.org
Thu Apr 4 01:39:09 CEST 2013


Author: Carl Meyer <carl at oddbird.net>
Branch: 
Changeset: r62995:5b253d146851
Date: 2013-04-03 17:38 -0600
http://bitbucket.org/pypy/pypy/changeset/5b253d146851/

Log:	Fix home and user distutils installation schemes. (issue1272)

diff --git a/lib-python/2.7/distutils/command/install.py b/lib-python/2.7/distutils/command/install.py
--- a/lib-python/2.7/distutils/command/install.py
+++ b/lib-python/2.7/distutils/command/install.py
@@ -474,7 +474,8 @@
 
     def select_scheme (self, name):
         # it's the caller's problem if they supply a bad name!
-        if hasattr(sys, 'pypy_version_info'):
+        if hasattr(sys, 'pypy_version_info') and not (
+                name.endswith('_user') or name.endswith('_home')):
             name = 'pypy'
         scheme = INSTALL_SCHEMES[name]
         for key in SCHEME_KEYS:
diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py b/lib-python/2.7/distutils/sysconfig_pypy.py
--- a/lib-python/2.7/distutils/sysconfig_pypy.py
+++ b/lib-python/2.7/distutils/sysconfig_pypy.py
@@ -96,6 +96,9 @@
         else:
             _config_vars = {}
 
+        _config_vars['prefix'] = PREFIX
+        _config_vars['exec_prefix'] = EXEC_PREFIX
+
     if args:
         vals = []
         for name in args:
diff --git a/lib-python/2.7/distutils/tests/test_install.py b/lib-python/2.7/distutils/tests/test_install.py
--- a/lib-python/2.7/distutils/tests/test_install.py
+++ b/lib-python/2.7/distutils/tests/test_install.py
@@ -4,7 +4,6 @@
 import sys
 import unittest
 import site
-from test import test_support
 
 from test.test_support import captured_stdout, run_unittest
 
@@ -57,15 +56,14 @@
             expected = os.path.normpath(expected)
             self.assertEqual(got, expected)
 
-        if test_support.check_impl_detail():
-            libdir = os.path.join(destination, "lib", "python")
-            check_path(cmd.install_lib, libdir)
-            check_path(cmd.install_platlib, libdir)
-            check_path(cmd.install_purelib, libdir)
-            check_path(cmd.install_headers,
-                       os.path.join(destination, "include", "python", "foopkg"))
-            check_path(cmd.install_scripts, os.path.join(destination, "bin"))
-            check_path(cmd.install_data, destination)
+        libdir = os.path.join(destination, "lib", "python")
+        check_path(cmd.install_lib, libdir)
+        check_path(cmd.install_platlib, libdir)
+        check_path(cmd.install_purelib, libdir)
+        check_path(cmd.install_headers,
+                   os.path.join(destination, "include", "python", "foopkg"))
+        check_path(cmd.install_scripts, os.path.join(destination, "bin"))
+        check_path(cmd.install_data, destination)
 
     def test_user_site(self):
         # site.USER_SITE was introduced in 2.6


More information about the pypy-commit mailing list