mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
0772ab3e24
PyPI versions -- Replaces the always phone back to pypi.python.org JSON call -- This allows us specify a local mirror to be use to query for updated version and respects other set options -- Update tests -- Fix setup.py to include freezegun for tests
15 lines
425 B
Python
15 lines
425 B
Python
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
|
|
|
|
|
class Index(object):
|
|
def __init__(self, url):
|
|
self.url = url
|
|
self.netloc = urllib_parse.urlsplit(url).netloc
|
|
self.simple_url = self.url_to_path('simple')
|
|
self.pypi_url = self.url_to_path('pypi')
|
|
|
|
def url_to_path(self, path):
|
|
return urllib_parse.urljoin(self.url, path)
|
|
|
|
|
|
PyPI = Index('https://pypi.python.org/')
|