Skip to content

Commit fd99bd3

Browse files
committed
remove unnecessary patches since setuptools-0.8 will be py2/3 compatible
1 parent a4f178b commit fd99bd3

File tree

1 file changed

+8
-30
lines changed

1 file changed

+8
-30
lines changed

pip/req.py

+8-30
Original file line numberDiff line numberDiff line change
@@ -237,20 +237,10 @@ def run_egg_info(self, force_root_egg_info=False):
237237
if self.name == 'distribute' and not os.path.isdir(os.path.join(self.source_dir, 'setuptools')):
238238
rmtree(os.path.join(self.source_dir, 'distribute.egg-info'))
239239

240-
# setuptools-0.7.2 is not 2/3 compatible and requires 2to3. the use
241-
# of self._run_setup.py makes it impossible for 2to3 to get run on
242-
# the setuptools that needs to be imported, so we work with
243-
# "setup.py" directly. just for setuptools
244-
# NOTE: this self.name check only works when installing from a specifier
245-
# (not archive path/urls)
246-
# TODO: take this out later
247-
if self.name in ['setuptools']:
248-
egg_info_cmd = [sys.executable, 'setup.py', 'egg_info']
249-
else:
250-
script = self._run_setup_py
251-
script = script.replace('__SETUP_PY__', repr(self.setup_py))
252-
script = script.replace('__PKG_NAME__', repr(self.name))
253-
egg_info_cmd = [sys.executable, '-c', script, 'egg_info']
240+
script = self._run_setup_py
241+
script = script.replace('__SETUP_PY__', repr(self.setup_py))
242+
script = script.replace('__PKG_NAME__', repr(self.name))
243+
egg_info_cmd = [sys.executable, '-c', script, 'egg_info']
254244
# We can't put the .egg-info files at the root, because then the source code will be mistaken
255245
# for an installed egg, causing problems
256246
if self.editable or force_root_egg_info:
@@ -607,22 +597,10 @@ def install(self, install_options, global_options=(), root=None):
607597
record_filename = os.path.join(temp_location, 'install-record.txt')
608598
try:
609599
install_args = [sys.executable]
610-
611-
# setuptools-0.7.2 is not 2/3 compatible and requires 2to3. the use
612-
# of the "import setuptools" override makes it impossible for 2to3
613-
# to get run on the setuptools that needs to be imported, so we work
614-
# with "setup.py" directly just for setuptools
615-
# NOTE: this self.name check only works when installing from a specifier
616-
# (not archive path/urls)
617-
# TODO: take this out later
618-
if self.name in ['setuptools']:
619-
install_args.append('setup.py')
620-
else:
621-
install_args.append('-c')
622-
install_args.append(
623-
"import setuptools;__file__=%r;"\
624-
"exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))" % self.setup_py)
625-
600+
install_args.append('-c')
601+
install_args.append(
602+
"import setuptools;__file__=%r;"\
603+
"exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))" % self.setup_py)
626604
install_args += list(global_options) + ['install','--record', record_filename]
627605

628606
if not self.as_egg:

0 commit comments

Comments
 (0)