##// END OF EJS Templates
setup: remove support for 2to3...
Gregory Szorc -
r28398:71229894 default
parent child Browse files
Show More
@@ -84,19 +84,6 b' from distutils.errors import ('
84 from distutils.sysconfig import get_python_inc, get_config_var
84 from distutils.sysconfig import get_python_inc, get_config_var
85 from distutils.version import StrictVersion
85 from distutils.version import StrictVersion
86
86
87 convert2to3 = '--c2to3' in sys.argv
88 if convert2to3:
89 try:
90 from distutils.command.build_py import build_py_2to3 as build_py
91 from lib2to3.refactor import get_fixers_from_package as getfixers
92 except ImportError:
93 if sys.version_info[0] < 3:
94 raise SystemExit("--c2to3 is only compatible with python3.")
95 raise
96 sys.path.append('contrib')
97 elif sys.version_info[0] >= 3:
98 raise SystemExit("setup.py with python3 needs --c2to3 (experimental)")
99
100 scripts = ['hg']
87 scripts = ['hg']
101 if os.name == 'nt':
88 if os.name == 'nt':
102 # We remove hg.bat if we are able to build hg.exe.
89 # We remove hg.bat if we are able to build hg.exe.
@@ -235,15 +222,7 b' except ImportError:'
235 class hgbuild(build):
222 class hgbuild(build):
236 # Insert hgbuildmo first so that files in mercurial/locale/ are found
223 # Insert hgbuildmo first so that files in mercurial/locale/ are found
237 # when build_py is run next.
224 # when build_py is run next.
238 sub_commands = [('build_mo', None),
225 sub_commands = [('build_mo', None)] + build.sub_commands
239
240 # We also need build_ext before build_py. Otherwise, when 2to3 is
241 # called (in build_py), it will not find osutil & friends,
242 # thinking that those modules are global and, consequently, making
243 # a mess, now that all module imports are global.
244
245 ('build_ext', build.has_ext_modules),
246 ] + build.sub_commands
247
226
248 class hgbuildmo(build):
227 class hgbuildmo(build):
249
228
@@ -282,8 +261,6 b' class hgdist(Distribution):'
282 global_options = Distribution.global_options + \
261 global_options = Distribution.global_options + \
283 [('pure', None, "use pure (slow) Python "
262 [('pure', None, "use pure (slow) Python "
284 "code instead of C extensions"),
263 "code instead of C extensions"),
285 ('c2to3', None, "(experimental!) convert "
286 "code with 2to3"),
287 ]
264 ]
288
265
289 def has_ext_modules(self):
266 def has_ext_modules(self):
@@ -328,10 +305,6 b' class hgbuildscripts(build_scripts):'
328 return build_scripts.run(self)
305 return build_scripts.run(self)
329
306
330 class hgbuildpy(build_py):
307 class hgbuildpy(build_py):
331 if convert2to3:
332 fixer_names = sorted(set(getfixers("lib2to3.fixes") +
333 getfixers("hgfixes")))
334
335 def finalize_options(self):
308 def finalize_options(self):
336 build_py.finalize_options(self)
309 build_py.finalize_options(self)
337
310
General Comments 0
You need to be logged in to leave comments. Login now