summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2009-09-01 03:04:01 +0200
committerJannis Leidel <jannis@leidel.info>2009-09-01 03:04:01 +0200
commit78ec0268b21c4bac7406a9be70675967597f2297 (patch)
tree7825e2562ad2f5c8f6c4586cf42e8ddf3481ea65
parent8922a1ead4c503e85e6ad03c7c1fe236258e0554 (diff)
downloadpip-78ec0268b21c4bac7406a9be70675967597f2297.tar.gz
Added --no-index option to install and bundle command which temporarily disables querying the package index
-rw-r--r--pip.py23
-rw-r--r--setup.py7
2 files changed, 19 insertions, 11 deletions
diff --git a/pip.py b/pip.py
index c5d24e559..8aad804d8 100644
--- a/pip.py
+++ b/pip.py
@@ -377,6 +377,12 @@ class InstallCommand(Command):
action='append',
default=[],
help='extra URLs of package indexes to use in addition to --index-url')
+ self.parser.add_option(
+ '--no-index',
+ dest='no_index',
+ action='store_true',
+ default=False,
+ help='Ignore package index (only looking at --find-links URLs instead)')
self.parser.add_option(
'-b', '--build', '--build-dir', '--build-directory',
@@ -432,6 +438,9 @@ class InstallCommand(Command):
options.src_dir = os.path.abspath(options.src_dir)
install_options = options.install_options or []
index_urls = [options.index_url] + options.extra_index_urls
+ if options.no_index:
+ logger.notify('Ignoring indexes: %s' % ','.join(index_urls))
+ index_urls = []
finder = PackageFinder(
find_links=options.find_links,
index_urls=index_urls)
@@ -1079,12 +1088,14 @@ class PackageFinder(object):
def find_requirement(self, req, upgrade):
url_name = req.url_name
- # Check that we have the url_name correctly spelled:
- main_index_url = Link(posixpath.join(self.index_urls[0], url_name))
- # This will also cache the page, so it's okay that we get it again later:
- page = self._get_page(main_index_url, req)
- if page is None:
- url_name = self._find_url_name(Link(self.index_urls[0]), url_name, req) or req.url_name
+ # Only check main index if index URL is given:
+ if self.index_urls:
+ # Check that we have the url_name correctly spelled:
+ main_index_url = Link(posixpath.join(self.index_urls[0], url_name))
+ # This will also cache the page, so it's okay that we get it again later:
+ page = self._get_page(main_index_url, req)
+ if page is None:
+ url_name = self._find_url_name(Link(self.index_urls[0]), url_name, req) or req.url_name
def mkurl_pypi_url(url):
loc = posixpath.join(url, url_name)
# For maximum compatibility with easy_install, ensure the path
diff --git a/setup.py b/setup.py
index 1a1764f02..eaebfa645 100644
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,9 @@
import sys
-if sys.platform == 'win32':
- from setuptools import setup
-else:
- from distutils.core import setup
+from setuptools import setup
import os
-version = '0.4'
+version = '0.4.1'
doc_dir = os.path.join(os.path.dirname(__file__), 'docs')
index_filename = os.path.join(doc_dir, 'index.txt')