From 090f9acb7b07f86cd42e64ee797550cb573f81a4 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Tue, 25 Mar 2014 17:17:30 +0300 Subject: [PATCH] Pseudocode to fix issue #1299 I am not sure how to detect that pip is run as pip.exe --- pip/commands/install.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pip/commands/install.py b/pip/commands/install.py index 850a6ff6768..8c15fa61fa3 100644 --- a/pip/commands/install.py +++ b/pip/commands/install.py @@ -268,6 +268,9 @@ def run(self, options, args): session = self._build_session(options) + + # --- find package names and versions --- + finder = self._build_package_finder(options, index_urls, session) requirement_set = RequirementSet( @@ -311,6 +314,17 @@ def run(self, options, args): logger.warn(msg) return + + # --- download and install --- + + # pseudocode to solve issue #1299 + #if 'pip' in requirement_set: + # logger.notify('Attempt to update itself.') + # if pip_exe: + # logger.warn('Restarting pip with python.exe:') + # logger.warn(' python -m pip ...') + # os.execv(sys.executable, ['-m', 'pip', 'install'] + args) + try: if not options.no_download: requirement_set.prepare_files(