|
37 | 37 | class InstallRequirement(object):
|
38 | 38 |
|
39 | 39 | def __init__(self, req, comes_from, source_dir=None, editable=False,
|
40 |
| - url=None, as_egg=False, update=True, prereleases=None): |
| 40 | + url=None, as_egg=False, update=True, prereleases=None, |
| 41 | + from_bundle=False): |
41 | 42 | self.extras = ()
|
42 | 43 | if isinstance(req, string_types):
|
43 | 44 | req = pkg_resources.Requirement.parse(req)
|
@@ -65,6 +66,7 @@ def __init__(self, req, comes_from, source_dir=None, editable=False,
|
65 | 66 | self.uninstalled = None
|
66 | 67 | self.use_user_site = False
|
67 | 68 | self.target_dir = None
|
| 69 | + self.from_bundle = from_bundle |
68 | 70 |
|
69 | 71 | # True if pre-releases are acceptable
|
70 | 72 | if prereleases:
|
@@ -776,12 +778,10 @@ def bundle_requirements(self):
|
776 | 778 | url = None
|
777 | 779 | yield InstallRequirement(
|
778 | 780 | package, self, editable=True, url=url,
|
779 |
| - update=False, source_dir=dest_dir) |
| 781 | + update=False, source_dir=dest_dir, from_bundle=True) |
780 | 782 | for dest_dir in self._bundle_build_dirs:
|
781 | 783 | package = os.path.basename(dest_dir)
|
782 |
| - yield InstallRequirement( |
783 |
| - package, self, |
784 |
| - source_dir=dest_dir) |
| 784 | + yield InstallRequirement(package, self,source_dir=dest_dir, from_bundle=True) |
785 | 785 |
|
786 | 786 | def move_bundle_files(self, dest_build_dir, dest_src_dir):
|
787 | 787 | base = self._temp_build_dir
|
@@ -1059,9 +1059,14 @@ def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
|
1059 | 1059 | unpack = True
|
1060 | 1060 | url = None
|
1061 | 1061 |
|
1062 |
| - # If a checkout exists, it's unwise to keep going. |
1063 |
| - # Version inconsistencies are logged later, but do not fail the installation. |
1064 |
| - if os.path.exists(os.path.join(location, 'setup.py')): |
| 1062 | + # In the case where the req comes from a bundle, we should |
| 1063 | + # assume a build dir exists and move on |
| 1064 | + if req_to_install.from_bundle: |
| 1065 | + pass |
| 1066 | + # If a checkout exists, it's unwise to keep going. version |
| 1067 | + # inconsistencies are logged later, but do not fail the |
| 1068 | + # installation. |
| 1069 | + elif os.path.exists(os.path.join(location, 'setup.py')): |
1065 | 1070 | msg = textwrap.dedent("""
|
1066 | 1071 | pip can't proceed with requirement '%s' due to a pre-existing build directory.
|
1067 | 1072 | location: %s
|
|
0 commit comments