Skip to content

Commit 275ab7c

Browse files
committed
Switch pip to use Warehouse by default
1 parent 28f3ce6 commit 275ab7c

17 files changed

+56
-48
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pip
44
The `PyPA recommended`_ tool for installing Python packages.
55

66
.. image:: https://img.shields.io/pypi/v/pip.svg
7-
:target: https://pypi.python.org/pypi/pip
7+
:target: https://pypi.org/project/pip/
88

99
.. image:: https://img.shields.io/travis/pypa/pip/master.svg
1010
:target: http://travis-ci.org/pypa/pip

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pip
44
`User list <http://groups.google.com/group/python-virtualenv>`_ |
55
`Dev list <http://groups.google.com/group/pypa-dev>`_ |
66
`Github <https://github.com/pypa/pip>`_ |
7-
`PyPI <https://pypi.python.org/pypi/pip/>`_ |
7+
`PyPI <https://pypi.org/project/pip/>`_ |
88
User IRC: #pypa |
99
Dev IRC: #pypa-dev
1010

docs/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Uninstall a package:
6363
Successfully uninstalled SomePackage
6464

6565

66-
.. _PyPI: http://pypi.python.org/pypi/
66+
.. _PyPI: https://pypi.org/

docs/reference/pip_install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ Finding Packages
474474
++++++++++++++++
475475

476476
pip searches for packages on `PyPI`_ using the
477-
`http simple interface <http://pypi.python.org/simple>`_,
477+
`http simple interface <https://pypi.org/simple/>`_,
478478
which is documented `here <https://setuptools.readthedocs.io/en/latest/easy_install.html#package-index-api>`_
479479
and `there <http://www.python.org/dev/peps/pep-0301/>`_
480480

@@ -774,7 +774,7 @@ No other build system commands are invoked by the ``pip install`` command.
774774

775775
Installing a package from a wheel does not invoke the build system at all.
776776

777-
.. _PyPI: http://pypi.python.org/pypi/
777+
.. _PyPI: https://pypi.org/
778778
.. _setuptools extras: https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
779779

780780

docs/user_guide.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Specifiers`
4646

4747
For more information and examples, see the :ref:`pip install` reference.
4848

49-
.. _PyPI: http://pypi.python.org/pypi
49+
.. _PyPI: https://pypi.org/
5050

5151

5252
.. _`Requirements Files`:
@@ -197,7 +197,7 @@ For the cases where wheels are not available, pip offers :ref:`pip wheel` as a
197197
convenience, to build wheels for all your requirements and dependencies.
198198

199199
:ref:`pip wheel` requires the `wheel package
200-
<https://pypi.python.org/pypi/wheel>`_ to be installed, which provides the
200+
<https://pypi.org/project/wheel/>`_ to be installed, which provides the
201201
"bdist_wheel" setuptools extension that it uses.
202202

203203
To build wheels for your requirements and all their dependencies to a local directory:

news/5214.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Switch the default repository to the new "PyPI 2.0" running at https://pypi.org/.

src/pip/_internal/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ class Link(object):
903903

904904
def __init__(self, url, comes_from=None, requires_python=None):
905905
"""
906-
Object representing a parsed link from https://pypi.python.org/simple/*
906+
Object representing a parsed link from https://pypi.org/simple/*
907907
908908
url:
909909
url of the resource pointed to (href of the link)

src/pip/_internal/models/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def url_to_path(self, path):
1212
return urllib_parse.urljoin(self.url, path)
1313

1414

15-
PyPI = Index('https://pypi.python.org/')
15+
PyPI = Index('https://pypi.org/')

tests/functional/test_install_config.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def test_command_line_options_override_env_vars(script, virtualenv):
2424
Test that command line options override environmental variables.
2525
2626
"""
27-
script.environ['PIP_INDEX_URL'] = 'https://b.pypi.python.org/simple/'
27+
script.environ['PIP_INDEX_URL'] = 'https://example.com/simple/'
2828
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
2929
assert (
30-
"Getting page https://b.pypi.python.org/simple/initools"
30+
"Getting page https://example.com/simple/initools"
3131
in result.stdout
3232
)
3333
virtualenv.clear()
@@ -36,7 +36,7 @@ def test_command_line_options_override_env_vars(script, virtualenv):
3636
'INITools',
3737
expect_error=True,
3838
)
39-
assert "b.pypi.python.org" not in result.stdout
39+
assert "example.com" not in result.stdout
4040
assert "Getting page https://download.zope.org/ppix" in result.stdout
4141

4242

@@ -85,24 +85,24 @@ def test_command_line_append_flags(script, virtualenv, data):
8585
variables.
8686
8787
"""
88-
script.environ['PIP_FIND_LINKS'] = 'https://testpypi.python.org'
88+
script.environ['PIP_FIND_LINKS'] = 'https://test.pypi.org'
8989
result = script.pip(
9090
'install', '-vvv', 'INITools', '--trusted-host',
91-
'testpypi.python.org',
91+
'test.pypi.org',
9292
expect_error=True,
9393
)
9494
assert (
95-
"Analyzing links from page https://testpypi.python.org"
95+
"Analyzing links from page https://test.pypi.org"
9696
in result.stdout
9797
), str(result)
9898
virtualenv.clear()
9999
result = script.pip(
100100
'install', '-vvv', '--find-links', data.find_links, 'INITools',
101-
'--trusted-host', 'testpypi.python.org',
101+
'--trusted-host', 'test.pypi.org',
102102
expect_error=True,
103103
)
104104
assert (
105-
"Analyzing links from page https://testpypi.python.org"
105+
"Analyzing links from page https://test.pypi.org"
106106
in result.stdout
107107
)
108108
assert "Skipping link %s" % data.find_links in result.stdout
@@ -115,16 +115,16 @@ def test_command_line_appends_correctly(script, data):
115115
116116
"""
117117
script.environ['PIP_FIND_LINKS'] = (
118-
'https://testpypi.python.org %s' % data.find_links
118+
'https://test.pypi.org %s' % data.find_links
119119
)
120120
result = script.pip(
121121
'install', '-vvv', 'INITools', '--trusted-host',
122-
'testpypi.python.org',
122+
'test.pypi.org',
123123
expect_error=True,
124124
)
125125

126126
assert (
127-
"Analyzing links from page https://testpypi.python.org"
127+
"Analyzing links from page https://test.pypi.org"
128128
in result.stdout
129129
), result.stdout
130130
assert "Skipping link %s" % data.find_links in result.stdout
@@ -167,7 +167,7 @@ def _test_config_file_override_stack(script, virtualenv, config_file):
167167
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
168168
assert "Getting page https://pypi.gocept.com/initools" in result.stdout
169169
result = script.pip(
170-
'install', '-vvv', '--index-url', 'https://pypi.python.org/simple',
170+
'install', '-vvv', '--index-url', 'https://pypi.org/simple/',
171171
'INITools',
172172
expect_error=True,
173173
)
@@ -177,7 +177,7 @@ def _test_config_file_override_stack(script, virtualenv, config_file):
177177
)
178178
assert "Getting page https://pypi.gocept.com/INITools" not in result.stdout
179179
assert (
180-
"Getting page https://pypi.python.org/simple/initools" in result.stdout
180+
"Getting page https://pypi.org/simple/initools" in result.stdout
181181
)
182182

183183

tests/functional/test_install_upgrade.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def test_uninstall_before_upgrade_from_url(script):
221221
)
222222
result2 = script.pip(
223223
'install',
224-
'https://pypi.python.org/packages/source/I/INITools/INITools-'
224+
'https://files.pythonhosted.org/packages/source/I/INITools/INITools-'
225225
'0.3.tar.gz',
226226
expect_error=True,
227227
)
@@ -243,7 +243,7 @@ def test_upgrade_to_same_version_from_url(script):
243243
)
244244
result2 = script.pip(
245245
'install',
246-
'https://pypi.python.org/packages/source/I/INITools/INITools-'
246+
'https://files.pythonhosted.org/packages/source/I/INITools/INITools-'
247247
'0.3.tar.gz',
248248
expect_error=True,
249249
)
@@ -373,7 +373,7 @@ def test_upgrade_vcs_req_with_dist_found(script):
373373
)
374374
script.pip("install", req, expect_stderr=True)
375375
result = script.pip("install", "-U", req, expect_stderr=True)
376-
assert "pypi.python.org" not in result.stdout, result.stdout
376+
assert "pypi.org" not in result.stdout, result.stdout
377377

378378

379379
class TestUpgradeDistributeToSetuptools(object):

tests/functional/test_requests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ def test_timeout(script):
88
expect_error=True,
99
)
1010
assert (
11-
"Could not fetch URL https://pypi.python.org/simple/INITools/: "
11+
"Could not fetch URL https://pypi.org/simple/INITools/: "
1212
"timed out" in result.stdout
1313
)
1414
assert (
15-
"Could not fetch URL https://pypi.python.org/simple/: "
15+
"Could not fetch URL https://pypi.org/simple/: "
1616
"timed out" in result.stdout
1717
)

tests/functional/test_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_run_method_should_return_success_when_find_packages():
100100
Test SearchCommand.run for found package
101101
"""
102102
command = SearchCommand()
103-
cmdline = "--index=https://pypi.python.org/pypi pip"
103+
cmdline = "--index=https://pypi.org/pypi pip"
104104
options, args = command.parse_args(cmdline.split())
105105
status = command.run(options, args)
106106
assert status == SUCCESS
@@ -112,7 +112,7 @@ def test_run_method_should_return_no_matches_found_when_does_not_find_pkgs():
112112
Test SearchCommand.run for no matches
113113
"""
114114
command = SearchCommand()
115-
cmdline = "--index=https://pypi.python.org/pypi nonexistentpackage"
115+
cmdline = "--index=https://pypi.org/pypi nonexistentpackage"
116116
options, args = command.parse_args(cmdline.split())
117117
status = command.run(options, args)
118118
assert status == NO_MATCHES_FOUND

tests/scripts/test_all_pip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
def all_projects():
20-
data = urllib_request.urlopen('http://pypi.python.org/simple/').read()
20+
data = urllib_request.urlopen('http://pypi.org/simple/').read()
2121
projects = [m.group(1) for m in re.finditer(r'<a.*?>(.+)</a>', data)]
2222
return projects
2323

tests/unit/test_finder.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_finder_detects_latest_already_satisfied_pypi_links():
107107
req.satisfied_by = satisfied_by
108108
finder = PackageFinder(
109109
[],
110-
["http://pypi.python.org/simple"],
110+
["http://pypi.org/simple/"],
111111
session=PipSession(),
112112
)
113113

@@ -287,7 +287,7 @@ def test_finder_priority_file_over_page(data):
287287
req = InstallRequirement.from_line('gmpy==1.15', None)
288288
finder = PackageFinder(
289289
[data.find_links],
290-
["http://pypi.python.org/simple"],
290+
["http://pypi.org/simple/"],
291291
session=PipSession(),
292292
)
293293
all_versions = finder.find_all_candidates(req.name)
@@ -312,9 +312,10 @@ def test_finder_deplink():
312312
session=PipSession(),
313313
)
314314
finder.add_dependency_links(
315-
['https://pypi.python.org/packages/source/g/gmpy/gmpy-1.15.zip'])
315+
['https://files.pythonhosted.org/packages/source/g/gmpy/gmpy-1.15.zip']
316+
)
316317
link = finder.find_requirement(req, False)
317-
assert link.url.startswith("https://pypi"), link
318+
assert link.url.startswith("https://files.pythonhosted.org/"), link
318319

319320

320321
@pytest.mark.network
@@ -325,17 +326,22 @@ def test_finder_priority_page_over_deplink():
325326
req = InstallRequirement.from_line('pip==1.5.6', None)
326327
finder = PackageFinder(
327328
[],
328-
["https://pypi.python.org/simple"],
329+
["https://pypi.org/simple/"],
329330
process_dependency_links=True,
330331
session=PipSession(),
331332
)
332333
finder.add_dependency_links([
333-
'https://warehouse.python.org/packages/source/p/pip/pip-1.5.6.tar.gz'])
334+
'https://files.pythonhosted.org/packages/source/p/pip/pip-1.5.6.tar.gz'
335+
])
334336
all_versions = finder.find_all_candidates(req.name)
335337
# Check that the dependency_link is last
336-
assert all_versions[-1].location.url.startswith('https://warehouse')
338+
assert all_versions[-1].location.url.startswith(
339+
'https://files.pythonhosted.org/'
340+
)
337341
link = finder.find_requirement(req, False)
338-
assert link.url.startswith("https://pypi"), link
342+
assert link.url.startswith(
343+
"https://files.pythonhosted.org/packages/3f/08/7347ca4"
344+
), link
339345

340346

341347
def test_finder_priority_nonegg_over_eggfragments():

tests/unit/test_index.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ def warning(self, *args, **kwargs):
122122
@pytest.mark.parametrize(
123123
("location", "trusted", "expected"),
124124
[
125-
("http://pypi.python.org/something", [], True),
126-
("https://pypi.python.org/something", [], False),
127-
("git+http://pypi.python.org/something", [], True),
128-
("git+https://pypi.python.org/something", [], False),
129-
("git+ssh://git@pypi.python.org/something", [], False),
125+
("http://pypi.org/something", [], True),
126+
("https://pypi.org/something", [], False),
127+
("git+http://pypi.org/something", [], True),
128+
("git+https://pypi.org/something", [], False),
129+
("git+ssh://[email protected]/something", [], False),
130130
("http://localhost", [], False),
131131
("http://127.0.0.1", [], False),
132132
("http://example.com/something/", [], True),

tests/unit/test_req.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,27 @@ def test_missing_hash_checking(self):
115115
# This hash should be accepted because it came from the reqs file, not
116116
# from the internet:
117117
reqset.add_requirement(get_processed_req_from_line(
118-
'https://pypi.python.org/packages/source/m/more-itertools/'
118+
'https://files.pythonhosted.org/packages/source/m/more-itertools/'
119119
'more-itertools-1.0.tar.gz#md5=b21850c3cfa7efbb70fd662ab5413bdd',
120120
lineno=3,
121121
))
122122
# The error text should list this as a URL and not `peep==3.1.1`:
123123
reqset.add_requirement(get_processed_req_from_line(
124-
'https://pypi.python.org/packages/source/p/peep/peep-3.1.1.tar.gz',
124+
'https://files.pythonhosted.org/'
125+
'packages/source/p/peep/peep-3.1.1.tar.gz',
125126
lineno=4,
126127
))
127128
finder = PackageFinder(
128129
[],
129-
['https://pypi.python.org/simple'],
130+
['https://pypi.org/simple/'],
130131
session=PipSession(),
131132
)
132133
resolver = self._basic_resolver(finder)
133134
assert_raises_regexp(
134135
HashErrors,
135136
r'Hashes are required in --require-hashes mode, but they are '
136137
r'missing .*\n'
137-
r' https://pypi\.python\.org/packages/source/p/peep/peep'
138+
r' https://files\.pythonhosted\.org/packages/source/p/peep/peep'
138139
r'-3\.1\.1\.tar\.gz --hash=sha256:[0-9a-f]+\n'
139140
r' blessings==1.0 --hash=sha256:[0-9a-f]+\n'
140141
r'THESE PACKAGES DO NOT MATCH THE HASHES.*\n'

tests/unit/test_unit_outdated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class MockPackageFinder(object):
1616

17-
BASE_URL = 'https://pypi.python.org/simple/pip-{0}.tar.gz'
17+
BASE_URL = 'https://pypi.org/simple/pip-{0}.tar.gz'
1818
PIP_PROJECT_NAME = 'pip'
1919
INSTALLATION_CANDIDATES = [
2020
InstallationCandidate(PIP_PROJECT_NAME, '6.9.0',

0 commit comments

Comments
 (0)