summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Cross <hodgestar+hg@gmail.com>2010-04-15 15:27:00 +0200
committerSimon Cross <hodgestar+hg@gmail.com>2010-04-15 15:27:00 +0200
commitbaa49969fd9d562f4819e57e7312d87082d2c1df (patch)
tree30b0307113f4d1e3e6026c569b04b42f872fb4f9
parent87fc3be96951ea589dacfb607baeb9e170364138 (diff)
downloadpip-baa49969fd9d562f4819e57e7312d87082d2c1df.tar.gz
Add search for source folders if not downloading files (--no-download tests should now pass).
-rw-r--r--pip/commands/install.py2
-rw-r--r--pip/req.py28
2 files changed, 30 insertions, 0 deletions
diff --git a/pip/commands/install.py b/pip/commands/install.py
index 104f6cda0..7e688edcf 100644
--- a/pip/commands/install.py
+++ b/pip/commands/install.py
@@ -159,6 +159,8 @@ class InstallCommand(Command):
requirement_set.add_requirement(req)
if not options.no_download:
requirement_set.install_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
+ else:
+ requirement_set.locate_files()
if not options.no_install and not self.bundle:
requirement_set.install(install_options)
installed = ' '.join([req.name for req in
diff --git a/pip/req.py b/pip/req.py
index 6536d903d..fd591d846 100644
--- a/pip/req.py
+++ b/pip/req.py
@@ -769,6 +769,34 @@ class RequirementSet(object):
req.uninstall(auto_confirm=auto_confirm)
req.commit_uninstall()
+ def locate_files(self):
+ unnamed = list(self.unnamed_requirements)
+ reqs = self.requirements.values()
+ while reqs or unnamed:
+ if unnamed:
+ req_to_install = unnamed.pop(0)
+ else:
+ req_to_install = reqs.pop(0)
+ install_needed = True
+ if not self.ignore_installed and not req_to_install.editable:
+ req_to_install.check_if_exists()
+ if req_to_install.satisfied_by:
+ if self.upgrade:
+ req_to_install.conflicts_with = req_to_install.satisfied_by
+ req_to_install.satisfied_by = None
+ else:
+ install_needed = False
+ if req_to_install.satisfied_by:
+ logger.notify('Requirement already satisfied '
+ '(use --upgrade to upgrade): %s'
+ % req_to_install)
+
+ if req_to_install.editable:
+ if req_to_install.source_dir is None:
+ req_to_install.source_dir = req_to_install.build_location(self.src_dir)
+ elif install_needed:
+ req_to_install.source_dir = req_to_install.build_location(self.build_dir, not self.is_download)
+
def install_files(self, finder, force_root_egg_info=False, bundle=False):
unnamed = list(self.unnamed_requirements)
reqs = self.requirements.values()