|
56 | 56 | ) |
57 | 57 | from setuptools import Command |
58 | 58 | from setuptools.archive_util import unpack_archive |
59 | | -from setuptools.command import bdist_egg, egg_info, setopt |
| 59 | +from setuptools.command import bdist_egg, setopt |
60 | 60 | from setuptools.package_index import URL_SCHEME, PackageIndex, parse_requirement_arg |
61 | | -from setuptools.sandbox import run_setup |
62 | 61 | from setuptools.warnings import SetuptoolsDeprecationWarning, SetuptoolsWarning |
63 | 62 | from setuptools.wheel import Wheel |
64 | 63 |
|
@@ -424,33 +423,7 @@ def expand_dirs(self) -> None: |
424 | 423 | self._expand_attrs(dirs) |
425 | 424 |
|
426 | 425 | def run(self, show_deprecation: bool = True) -> None: |
427 | | - if show_deprecation: |
428 | | - self.announce( |
429 | | - "WARNING: The easy_install command is deprecated " |
430 | | - "and will be removed in a future version.", |
431 | | - log.WARN, |
432 | | - ) |
433 | | - if self.verbose != self.distribution.verbose: |
434 | | - log.set_verbosity(self.verbose) |
435 | | - try: |
436 | | - for spec in self.args: |
437 | | - self.easy_install(spec, not self.no_deps) |
438 | | - if self.record: |
439 | | - outputs = self.outputs |
440 | | - if self.root: # strip any package prefix |
441 | | - root_len = len(self.root) |
442 | | - for counter in range(len(outputs)): |
443 | | - outputs[counter] = outputs[counter][root_len:] |
444 | | - from distutils import file_util |
445 | | - |
446 | | - self.execute( |
447 | | - file_util.write_file, |
448 | | - (self.record, outputs), |
449 | | - f"writing list of installed files to '{self.record}'", |
450 | | - ) |
451 | | - self.warn_deprecated_options() |
452 | | - finally: |
453 | | - log.set_verbosity(self.distribution.verbose) |
| 426 | + raise RuntimeError("easy_install command is disabled") |
454 | 427 |
|
455 | 428 | def pseudo_tempname(self): |
456 | 429 | """Return a pseudo-tempname base in the install directory. |
@@ -1175,23 +1148,8 @@ def report_editable(self, spec, setup_script): |
1175 | 1148 | python = sys.executable |
1176 | 1149 | return '\n' + self.__editable_msg % locals() |
1177 | 1150 |
|
1178 | | - def run_setup(self, setup_script, setup_base, args) -> None: |
1179 | | - sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg) |
1180 | | - sys.modules.setdefault('distutils.command.egg_info', egg_info) |
1181 | | - |
1182 | | - args = list(args) |
1183 | | - if self.verbose > 2: |
1184 | | - v = 'v' * (self.verbose - 1) |
1185 | | - args.insert(0, '-' + v) |
1186 | | - elif self.verbose < 2: |
1187 | | - args.insert(0, '-q') |
1188 | | - if self.dry_run: |
1189 | | - args.insert(0, '-n') |
1190 | | - log.info("Running %s %s", setup_script[len(setup_base) + 1 :], ' '.join(args)) |
1191 | | - try: |
1192 | | - run_setup(setup_script, args) |
1193 | | - except SystemExit as v: |
1194 | | - raise DistutilsError(f"Setup script exited with {v.args[0]}") from v |
| 1151 | + def run_setup(self, setup_script, setup_base, args) -> NoReturn: |
| 1152 | + raise NotImplementedError("easy_install support has been removed") |
1195 | 1153 |
|
1196 | 1154 | def build_and_install(self, setup_script, setup_base): |
1197 | 1155 | args = ['bdist_egg', '--dist-dir'] |
|
0 commit comments