1. Jason Pellerin
  2. pip

Commits

jpellerin  committed ccfba4b Merge

Merged upstream

  • Participants
  • Parent commits 5ebf64c, 593d6b7
  • Branches trunk

Comments (0)

Files changed (2)

File docs/news.txt

View file
  • Ignore whitespace
 
 * Fix some filename issues on Windows.
 
+* Allow the ``-i`` and ``--extra-index-url`` options in requirements
+  files.
+
 0.3.1
 -----
 

File pip.py

View file
  • Ignore whitespace
         find_links = options.find_links or []
         ## FIXME: Obviously this should be settable:
         find_tags = False
+        skip_match = None
+        if os.environ.get('PIP_SKIP_REQUIREMENTS_REGEX'):
+            skip_match = re.compile(os.environ['PIP_SKIP_REQUIREMENTS_REGEX'])
 
         if filename == '-':
             logger.move_stdout_to_stderr()
                 if not line.strip() or line.strip().startswith('#'):
                     f.write(line)
                     continue
+                if skip_match and skip_match.search(line):
+                    f.write(line)
+                    continue
                 elif line.startswith('-e') or line.startswith('--editable'):
                     if line.startswith('-e'):
                         line = line[2:].strip()
                             % (display_path(dest), url))
                 logger.notify('Updating clone %s%s'
                               % (display_path(dest), rev_display))
-                call_subprocess(['hg', 'fetch', '-q'], cwd=dest)
+                call_subprocess(['hg', 'pull', '-q'], cwd=dest)
                 call_subprocess(
                     ['hg', 'update', '-q'] + rev_options, cwd=dest)
             else:
             ## FIXME: it would be nice to keep track of the source of
             ## the find_links:
             finder.find_links.append(line)
+        elif line.startswith('-i') or line.startswith('--index-url'):
+            if line.startswith('-i'):
+                line = line[2:].strip()
+            else:
+                line = line[len('--index-url'):].strip().lstrip('=')
+            finder.index_urls = [line]
+        elif line.startswith('--extra-index-url'):
+            line = line[len('--extra-index-url'):].strip().lstrip('=')
+            finder.index_urls.append(line)
         else:
             comes_from = '-r %s (line %s)' % (filename, line_number)
             if line.startswith('-e') or line.startswith('--editable'):