1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/pip/models/index.py
Cooper Lees 0772ab3e24 - Change the pip outdated check to use PackageFinder to find current
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
2017-03-23 10:50:02 -07:00

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/')