diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-01-24 00:20:59 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-01-24 01:14:45 +0000 |
commit | 99b7b6450f4a71eed229607ccc1b8d567b59bf02 (patch) | |
tree | 1ec9da0025c68f950b270ac7e0c18dfad3020bd6 /setuptools/command/install_scripts.py | |
parent | e5681c0e0d1292921a84dac61ba56e3cda8d857f (diff) | |
download | python-setuptools-git-99b7b6450f4a71eed229607ccc1b8d567b59bf02.tar.gz |
Delay imports of pkg_resources in install_scripts.py
Diffstat (limited to 'setuptools/command/install_scripts.py')
-rw-r--r-- | setuptools/command/install_scripts.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py index aeb0e424..8b3133f1 100644 --- a/setuptools/command/install_scripts.py +++ b/setuptools/command/install_scripts.py @@ -4,7 +4,6 @@ from distutils.errors import DistutilsModuleError import os import sys -from pkg_resources import Distribution, PathMetadata from .._path import ensure_directory @@ -16,8 +15,6 @@ class install_scripts(orig.install_scripts): self.no_ep = False def run(self): - import setuptools.command.easy_install as ei - self.run_command("egg_info") if self.distribution.scripts: orig.install_scripts.run(self) # run first to set up self.outfiles @@ -26,6 +23,12 @@ class install_scripts(orig.install_scripts): if self.no_ep: # don't install entry point scripts into .egg file! return + self._install_ep_scripts() + + def _install_ep_scripts(self): + # Delay import side-effects + from pkg_resources import Distribution, PathMetadata + from . import easy_install as ei ei_cmd = self.get_finalized_command("egg_info") dist = Distribution( |