Ian Bicking avatar Ian Bicking committed 593d6b7 Merge

Comments (0)

Files changed (3)

+pip installs Python packages.  It is a replacement for
+``easy_install``.  Documentation follows; to download `visit the PyPI
+entry <http://pypi.python.org/pypi/pip>`_ (or the `repository
 .. toctree::
 * Fix some filename issues on Windows.
+* Allow the ``-i`` and ``--extra-index-url`` options in requirements
+  files.
         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 == '-':
                 if not line.strip() or line.strip().startswith('#'):
+                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()
             ## FIXME: it would be nice to keep track of the source of
             ## the find_links:
+        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)
             comes_from = '-r %s (line %s)' % (filename, line_number)
             if line.startswith('-e') or line.startswith('--editable'):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.