Skip to content

Commit

Permalink
Update PyPI default URL to pypi.org (pex-tool#610)
Browse files Browse the repository at this point in the history
As of April 13th, 2018, pypi.org is the cannonical URL for PyPI.
The domain pypi.python.org still exists and redirects to pypi.org,
but might be disabled in the future.

https://packaging.python.org/guides/migrating-to-pypi-org/
  • Loading branch information
StephanErb authored and jsirois committed Oct 26, 2018
1 parent eac0233 commit e4b2128
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pex/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __eq__(self, other):


class PyPIFetcher(FetcherBase):
PYPI_BASE = 'https://pypi.python.org/simple/'
PYPI_BASE = 'https://pypi.org/simple/'

def __init__(self, pypi_base=PYPI_BASE, use_mirrors=False):
if use_mirrors:
Expand Down
10 changes: 5 additions & 5 deletions tests/test_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@


def test_pypifetcher():
fetcher = PyPIFetcher('https://pypi.python.org/simple')
assert fetcher._pypi_base == 'https://pypi.python.org/simple/'
assert fetcher.urls('setuptools') == ['https://pypi.python.org/simple/setuptools/']
fetcher = PyPIFetcher('https://pypi.org/simple')
assert fetcher._pypi_base == 'https://pypi.org/simple/'
assert fetcher.urls('setuptools') == ['https://pypi.org/simple/setuptools/']

fetcher = PyPIFetcher()
assert fetcher._pypi_base == 'https://pypi.python.org/simple/'
assert fetcher.urls('setuptools') == ['https://pypi.python.org/simple/setuptools/']
assert fetcher._pypi_base == 'https://pypi.org/simple/'
assert fetcher.urls('setuptools') == ['https://pypi.org/simple/setuptools/']

fetcher = PyPIFetcher('file:///srv/simple')
assert fetcher._pypi_base == 'file:///srv/simple/'
Expand Down
4 changes: 2 additions & 2 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def patch_requests():

@contextmanager
def make_url(blob, md5_fragment=None):
url = 'http://pypi.python.org/foo.tar.gz'
url = 'http://pypi.org/foo.tar.gz'
if md5_fragment:
url += '#md5=%s' % md5_fragment

Expand Down Expand Up @@ -148,7 +148,7 @@ def test_requests_context_retries_from_environment():

def timeout_side_effect(timeout_error=None, num_timeouts=1):
timeout_error = timeout_error or requests.packages.urllib3.exceptions.ConnectTimeoutError
url = 'http://pypi.python.org/foo.tar.gz'
url = 'http://pypi.org/foo.tar.gz'

num_requests = [0] # hack, because python closures?
def timeout(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_empty_iteration():

def assert_iteration(all_versions, *expected_versions, **iterator_kwargs):
def package_url(version):
return 'https://pypi.python.org/packages/source/p/pex/pex-%s.tar.gz' % version
return 'https://pypi.org/packages/source/p/pex/pex-%s.tar.gz' % version

urls = [package_url(v) for v in all_versions]
crawler_mock = mock.create_autospec(Crawler, spec_set=True)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_invalid_wheel_package_name(package_name):

def test_different_wheel_packages_should_be_equal():
pypi_package = WheelPackage(
'https://pypi.python.org/packages/9b/31/'
'https://pypi.org/packages/9b/31/'
'e9925a2b9a06f97c3450bac6107928d3533bfe64ca5615442504104321e8/'
'requests-2.12.1-py2.py3-none-any.whl'
)
Expand Down

0 comments on commit e4b2128

Please sign in to comment.