diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-11-16 09:40:21 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-11-16 09:40:21 -0500 |
| commit | 4d4dbd3c5c69f63418ca2f22e9d6a3b8185b2e00 (patch) | |
| tree | 01f6619f3630594bb677a10e4406fd822e9f6c26 /setuptools/dist.py | |
| parent | c5fa038292a9c7d6fe529c4d8001cec0d3bac9cf (diff) | |
| parent | 2c33dad04fd11ebd7fc8e15d0017ff2dc617e6a3 (diff) | |
| download | python-setuptools-git-4d4dbd3c5c69f63418ca2f22e9d6a3b8185b2e00.tar.gz | |
Merge with master
--HG--
branch : feature/issue-229
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 26c35c4c..99939f45 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -16,6 +16,7 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, import six from setuptools.depends import Require +from setuptools import windows_support import pkg_resources def _get_unpatched(cls): @@ -306,6 +307,21 @@ class Distribution(_Distribution): else: self.convert_2to3_doctests = [] + def get_egg_cache_dir(self): + egg_cache_dir = os.path.join(os.curdir, '.eggs') + if not os.path.exists(egg_cache_dir): + os.mkdir(egg_cache_dir) + windows_support.hide_file(egg_cache_dir) + readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt') + with open(readme_txt_filename, 'w') as f: + f.write('This directory contains eggs that were downloaded ' + 'by setuptools to build, test, and run plug-ins.\n\n') + f.write('This directory caches those eggs to prevent ' + 'repeated downloads.\n\n') + f.write('However, it is safe to delete this directory.\n\n') + + return egg_cache_dir + def fetch_build_egg(self, req): """Fetch an egg needed for building""" @@ -329,8 +345,9 @@ class Distribution(_Distribution): 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=os.curdir, exclude_scripts=True, + 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 ) |
