Gentoo Archives: gentoo-commits

From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" <arfrever@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/setuptools/files: distribute-0.6.16-fix_deprecation_warnings.patch
Date: Sun, 01 May 2011 00:23:31
Message-Id: 20110501002321.7E60920057@flycatcher.gentoo.org
1 arfrever 11/05/01 00:23:21
2
3 Added: distribute-0.6.16-fix_deprecation_warnings.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.0_alpha30_p21/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-python/setuptools/files/distribute-0.6.16-fix_deprecation_warnings.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/setuptools/files/distribute-0.6.16-fix_deprecation_warnings.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/setuptools/files/distribute-0.6.16-fix_deprecation_warnings.patch?rev=1.1&content-type=text/plain
14
15 Index: distribute-0.6.16-fix_deprecation_warnings.patch
16 ===================================================================
17 --- pkg_resources.py
18 +++ pkg_resources.py
19 @@ -210,9 +210,10 @@
20 needs some hacks for Linux and Mac OS X.
21 """
22 try:
23 - from distutils.util import get_platform
24 - except ImportError:
25 + # Python 2.7 or >=3.2
26 from sysconfig import get_platform
27 + except ImportError:
28 + from distutils.util import get_platform
29
30 plat = get_platform()
31 if sys.platform == "darwin" and not plat.startswith('macosx-'):
32 --- setuptools/command/bdist_egg.py
33 +++ setuptools/command/bdist_egg.py
34 @@ -7,10 +7,14 @@
35 from setuptools import Command
36 from distutils.dir_util import remove_tree, mkpath
37 try:
38 - from distutils.sysconfig import get_python_version, get_python_lib
39 + # Python 2.7 or >=3.2
40 + from sysconfig import get_path, get_python_version
41 + def _get_purelib():
42 + return get_path("purelib")
43 except ImportError:
44 - from sysconfig import get_python_version
45 - from distutils.sysconfig import get_python_lib
46 + from distutils.sysconfig import get_python_version, get_python_lib
47 + def _get_purelib():
48 + return get_python_lib(False)
49
50 from distutils import log
51 from distutils.errors import DistutilsSetupError
52 @@ -130,7 +134,7 @@
53 # Hack for packages that install data to install's --install-lib
54 self.get_finalized_command('install').install_lib = self.bdist_dir
55
56 - site_packages = os.path.normcase(os.path.realpath(get_python_lib()))
57 + site_packages = os.path.normcase(os.path.realpath(_get_purelib()))
58 old, self.distribution.data_files = self.distribution.data_files,[]
59
60 for item in old:
61 --- setuptools/command/build_ext.py
62 +++ setuptools/command/build_ext.py
63 @@ -9,9 +9,14 @@
64 from distutils.file_util import copy_file
65 from setuptools.extension import Library
66 from distutils.ccompiler import new_compiler
67 -from distutils.sysconfig import customize_compiler, get_config_var
68 -get_config_var("LDSHARED") # make sure _config_vars is initialized
69 -from distutils.sysconfig import _config_vars
70 +try:
71 + # Python 2.7 or >=3.2
72 + from distutils.ccompiler import customize_compiler
73 + from sysconfig import get_config_var, _CONFIG_VARS
74 +except ImportError:
75 + from distutils.sysconfig import customize_compiler, get_config_var
76 + get_config_var("LDSHARED") # make sure _config_vars is initialized
77 + from distutils.sysconfig import _config_vars as _CONFIG_VARS
78 from distutils import log
79 from distutils.errors import *
80
81 @@ -133,16 +138,16 @@
82 compiler=self.compiler, dry_run=self.dry_run, force=self.force
83 )
84 if sys.platform == "darwin":
85 - tmp = _config_vars.copy()
86 + tmp = _CONFIG_VARS.copy()
87 try:
88 # XXX Help! I don't have any idea whether these are right...
89 - _config_vars['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
90 - _config_vars['CCSHARED'] = " -dynamiclib"
91 - _config_vars['SO'] = ".dylib"
92 + _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
93 + _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
94 + _CONFIG_VARS['SO'] = ".dylib"
95 customize_compiler(compiler)
96 finally:
97 - _config_vars.clear()
98 - _config_vars.update(tmp)
99 + _CONFIG_VARS.clear()
100 + _CONFIG_VARS.update(tmp)
101 else:
102 customize_compiler(compiler)
103
104 --- setuptools/command/easy_install.py
105 +++ setuptools/command/easy_install.py
106 @@ -15,9 +15,22 @@
107 from setuptools import Command, _dont_write_bytecode
108 from setuptools.sandbox import run_setup
109 from distutils import log, dir_util
110 +try:
111 + # Python 2.7 or >=3.2
112 + from sysconfig import get_config_vars, get_path
113 + def _get_platlib():
114 + return get_path("platlib")
115 + def _get_purelib():
116 + return get_path("purelib")
117 +except ImportError:
118 + from distutils.sysconfig import get_config_vars, get_python_lib
119 + def _get_platlib():
120 + return get_python_lib(True)
121 + def _get_purelib():
122 + return get_python_lib(False)
123 +
124 from distutils.util import get_platform
125 from distutils.util import convert_path, subst_vars
126 -from distutils.sysconfig import get_python_lib, get_config_vars
127 from distutils.errors import DistutilsArgError, DistutilsOptionError, \
128 DistutilsError, DistutilsPlatformError
129 from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS
130 @@ -1348,8 +1361,7 @@
131 'Python',
132 sys.version[:3],
133 'site-packages'))
134 - for plat_specific in (0,1):
135 - site_lib = get_python_lib(plat_specific)
136 + for site_lib in (_get_purelib(), _get_platlib()):
137 if site_lib not in sitedirs: sitedirs.append(site_lib)
138
139 if HAS_USER_SITE: