diff options
| author | Benoit Pierre <benoit.pierre@gmail.com> | 2017-08-05 18:31:53 +0200 |
|---|---|---|
| committer | Benoit Pierre <benoit.pierre@gmail.com> | 2017-08-05 20:58:20 +0200 |
| commit | e5461b6ccc57596c7e9cf7837084f8a20eeec9b7 (patch) | |
| tree | af500bb4322e27a522db452fabd0e401fc61afb6 /setuptools/dist.py | |
| parent | aa41a7a58d0e1cd0dd6715b2d4057666410114c7 (diff) | |
| download | external_python_setuptools-e5461b6ccc57596c7e9cf7837084f8a20eeec9b7.tar.gz external_python_setuptools-e5461b6ccc57596c7e9cf7837084f8a20eeec9b7.tar.bz2 external_python_setuptools-e5461b6ccc57596c7e9cf7837084f8a20eeec9b7.zip | |
workaround easy_install bug
Don't reuse `easy_install` command in `Distribution.fetch_build_egg` implementation.
Fix #196.
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 21730f22..e1510b6f 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -485,36 +485,30 @@ class Distribution(Distribution_parse_config_files, _Distribution): def fetch_build_egg(self, req): """Fetch an egg needed for building""" - - try: - cmd = self._egg_fetcher - cmd.package_index.to_scan = [] - except AttributeError: - from setuptools.command.easy_install import easy_install - dist = self.__class__({'script_args': ['easy_install']}) - dist.parse_config_files() - opts = dist.get_option_dict('easy_install') - keep = ( - 'find_links', 'site_dirs', 'index_url', 'optimize', - 'site_dirs', 'allow_hosts' - ) - for key in list(opts): - if key not in keep: - del opts[key] # don't use any other settings - if self.dependency_links: - links = self.dependency_links[:] - if 'find_links' in opts: - links = opts['find_links'][1].split() + links - opts['find_links'] = ('setup', links) - install_dir = self.get_egg_cache_dir() - cmd = easy_install( - dist, args=["x"], install_dir=install_dir, - exclude_scripts=True, - always_copy=False, build_directory=None, editable=False, - upgrade=False, multi_version=True, no_report=True, user=False - ) - cmd.ensure_finalized() - self._egg_fetcher = cmd + from setuptools.command.easy_install import easy_install + dist = self.__class__({'script_args': ['easy_install']}) + dist.parse_config_files() + opts = dist.get_option_dict('easy_install') + keep = ( + 'find_links', 'site_dirs', 'index_url', 'optimize', + 'site_dirs', 'allow_hosts' + ) + for key in list(opts): + if key not in keep: + del opts[key] # don't use any other settings + if self.dependency_links: + links = self.dependency_links[:] + if 'find_links' in opts: + links = opts['find_links'][1].split() + links + opts['find_links'] = ('setup', links) + install_dir = self.get_egg_cache_dir() + cmd = easy_install( + dist, args=["x"], install_dir=install_dir, + exclude_scripts=True, + always_copy=False, build_directory=None, editable=False, + upgrade=False, multi_version=True, no_report=True, user=False + ) + cmd.ensure_finalized() return cmd.easy_install(req) def _set_global_opts_from_features(self): |
