Skip to content

Commit be9637f

Browse files
authored
Merge pull request #9189 from pradyunsg/drop-old-python-support
Drop support for Python 2.7 and Python 3.5
2 parents 726b66f + c7a7206 commit be9637f

File tree

13 files changed

+17
-114
lines changed

13 files changed

+17
-114
lines changed

.azure-pipelines/jobs/test-windows.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ jobs:
99
vmImage: ${{ parameters.vmImage }}
1010
strategy:
1111
matrix:
12-
"2.7-x86":
13-
python.version: '2.7'
14-
python.architecture: x86
15-
"2.7": # because Python 2!
16-
python.version: '2.7'
17-
python.architecture: x64
18-
"3.5": # lowest Py3 version
19-
python.version: '3.5'
12+
"3.6": # lowest Python version
13+
python.version: '3.6'
2014
python.architecture: x64
2115
"3.8": # current
2216
python.version: '3.8'
@@ -38,16 +32,10 @@ jobs:
3832
vmImage: ${{ parameters.vmImage }}
3933
strategy:
4034
matrix:
41-
"3.6":
42-
python.version: '3.6'
43-
python.architecture: x64
4435
"3.7":
4536
python.version: '3.7'
4637
python.architecture: x64
4738
# This is for Windows, so test x86 builds
48-
"3.5-x86":
49-
python.version: '3.5'
50-
python.architecture: x86
5139
"3.6-x86":
5240
python.version: '3.6'
5341
python.architecture: x86

.azure-pipelines/jobs/test.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
vmImage: ${{ parameters.vmImage }}
1010
strategy:
1111
matrix:
12-
"2.7":
13-
python.version: '2.7'
12+
"3.6": # lowest Python version
13+
python.version: '3.6'
1414
python.architecture: x64
1515
"3.8":
1616
python.version: '3.8'
@@ -29,12 +29,6 @@ jobs:
2929
vmImage: ${{ parameters.vmImage }}
3030
strategy:
3131
matrix:
32-
"3.5":
33-
python.version: '3.5'
34-
python.architecture: x64
35-
"3.6":
36-
python.version: '3.6'
37-
python.architecture: x64
3832
"3.7":
3933
python.version: '3.7'
4034
python.architecture: x64

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
strategy:
9292
fail-fast: false
9393
matrix:
94-
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
94+
python: [3.6, 3.7, 3.8, 3.9]
9595

9696
steps:
9797
# Caches

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@ jobs:
2323
# PyPy
2424
- stage: secondary
2525
env: GROUP=1
26-
python: pypy3.5-7.0.0
26+
python: pypy3.6-7.3.1
2727
- env: GROUP=2
28-
python: pypy3.5-7.0.0
29-
- env: GROUP=1
30-
python: pypy2.7-7.1.1
31-
- env: GROUP=2
32-
python: pypy2.7-7.1.1
28+
python: pypy3.6-7.3.1
3329

3430
before_install: tools/travis/setup.sh
3531
install: travis_retry tools/travis/install.sh

docs/html/development/ci.rst

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ Supported interpreters
1717

1818
pip support a variety of Python interpreters:
1919

20-
- CPython 2.7
21-
- CPython 3.5
2220
- CPython 3.6
2321
- CPython 3.7
2422
- CPython 3.8
25-
- Latest PyPy
2623
- Latest PyPy3
2724

2825
on different operating systems:
@@ -95,87 +92,52 @@ Actual testing
9592
+------------------------------+---------------+-----------------+
9693
| **interpreter** | **unit** | **integration** |
9794
+-----------+----------+-------+---------------+-----------------+
98-
| | | CP2.7 | Azure | Azure |
99-
| | +-------+---------------+-----------------+
100-
| | | CP3.5 | Azure | |
10195
| | +-------+---------------+-----------------+
10296
| | | CP3.6 | Azure | |
10397
| | +-------+---------------+-----------------+
10498
| | x86 | CP3.7 | Azure | |
10599
| | +-------+---------------+-----------------+
106100
| | | CP3.8 | Azure | |
107101
| | +-------+---------------+-----------------+
108-
| | | PyPy | | |
109-
| | +-------+---------------+-----------------+
110102
| | | PyPy3 | | |
111103
| Windows +----------+-------+---------------+-----------------+
112-
| | | CP2.7 | Azure | Azure |
113-
| | +-------+---------------+-----------------+
114-
| | | CP3.5 | Azure | Azure |
115-
| | +-------+---------------+-----------------+
116104
| | | CP3.6 | Azure | |
117105
| | +-------+---------------+-----------------+
118106
| | x64 | CP3.7 | Azure | |
119107
| | +-------+---------------+-----------------+
120108
| | | CP3.8 | Azure | Azure |
121109
| | +-------+---------------+-----------------+
122-
| | | PyPy | | |
123-
| | +-------+---------------+-----------------+
124110
| | | PyPy3 | | |
125111
+-----------+----------+-------+---------------+-----------------+
126-
| | | CP2.7 | | |
127-
| | +-------+---------------+-----------------+
128-
| | | CP3.5 | | |
129-
| | +-------+---------------+-----------------+
130112
| | | CP3.6 | | |
131113
| | +-------+---------------+-----------------+
132114
| | x86 | CP3.7 | | |
133115
| | +-------+---------------+-----------------+
134116
| | | CP3.8 | | |
135117
| | +-------+---------------+-----------------+
136-
| | | PyPy | | |
137-
| | +-------+---------------+-----------------+
138118
| | | PyPy3 | | |
139119
| Linux +----------+-------+---------------+-----------------+
140-
| | | CP2.7 | Azure | Azure |
141-
| | +-------+---------------+-----------------+
142-
| | | CP3.5 | Azure | Azure |
143-
| | +-------+---------------+-----------------+
144120
| | | CP3.6 | Azure | Azure |
145121
| | +-------+---------------+-----------------+
146122
| | x64 | CP3.7 | Azure | Azure |
147123
| | +-------+---------------+-----------------+
148124
| | | CP3.8 | Azure | Azure |
149125
| | +-------+---------------+-----------------+
150-
| | | PyPy | Travis | Travis |
151-
| | +-------+---------------+-----------------+
152126
| | | PyPy3 | Travis | Travis |
153127
+-----------+----------+-------+---------------+-----------------+
154-
| | | CP2.7 | | |
155-
| | +-------+---------------+-----------------+
156-
| | | CP3.5 | | |
157-
| | +-------+---------------+-----------------+
158128
| | | CP3.6 | | |
159129
| | +-------+---------------+-----------------+
160130
| | x86 | CP3.7 | | |
161131
| | +-------+---------------+-----------------+
162132
| | | CP3.8 | | |
163133
| | +-------+---------------+-----------------+
164-
| | | PyPy | | |
165-
| | +-------+---------------+-----------------+
166134
| | | PyPy3 | | |
167135
| MacOS +----------+-------+---------------+-----------------+
168-
| | | CP2.7 | Azure | Azure |
169-
| | +-------+---------------+-----------------+
170-
| | | CP3.5 | Azure | Azure |
171-
| | +-------+---------------+-----------------+
172136
| | | CP3.6 | Azure | Azure |
173137
| | +-------+---------------+-----------------+
174138
| | x64 | CP3.7 | Azure | Azure |
175139
| | +-------+---------------+-----------------+
176140
| | | CP3.8 | Azure | Azure |
177141
| | +-------+---------------+-----------------+
178-
| | | PyPy | | |
179-
| | +-------+---------------+-----------------+
180142
| | | PyPy3 | | |
181143
+-----------+----------+-------+---------------+-----------------+

docs/html/development/release-process.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,9 @@ their merits.
7070
Python 2 Support
7171
----------------
7272

73-
pip will continue to ensure that it runs on Python 2.7 after the `CPython 2.7
74-
EOL date`_. Support for Python 2.7 will be dropped, if bugs in Python 2.7 itself
75-
make this necessary (which is unlikely) or in pip 21.0 (Jan 2021), whichever is
76-
earlier.
77-
78-
However, bugs reported with pip which only occur on Python 2.7 would likely not
79-
be addressed directly by pip's maintainers. Pull Requests to fix Python 2.7
80-
only bugs will be considered, and merged (subject to normal review processes).
81-
Note that there may be delays due to the lack of developer resources for
82-
reviewing such pull requests.
73+
pip 20.3 was the last version of pip that supported Python 2. Bugs reported
74+
with pip which only occur on Python 2.7 will likely be closed as "won't fix"
75+
issues by pip's maintainers.
8376

8477
Python Support Policy
8578
---------------------

docs/html/installing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Upgrading pip
206206
Python and OS Compatibility
207207
===========================
208208

209-
pip works with CPython versions 2.7, 3.5, 3.6, 3.7, 3.8 and also PyPy.
209+
pip works with CPython versions 3.6, 3.7, 3.8 and also PyPy.
210210

211211
This means pip works on the latest patch version of each of these minor
212212
versions. Previous patch versions are supported on a best effort approach.

news/6148.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for Python 2.

news/9189.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for Python 3.5.

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def should_update_common_wheels():
7070
# completely to nox for all our automation. Contributors should prefer using
7171
# `tox -e ...` until this note is removed.
7272
# -----------------------------------------------------------------------------
73-
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy", "pypy3"])
73+
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "pypy3"])
7474
def test(session):
7575
# Get the common wheels.
7676
if should_update_common_wheels():

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ def get_version(rel_path):
4040
"License :: OSI Approved :: MIT License",
4141
"Topic :: Software Development :: Build Tools",
4242
"Programming Language :: Python",
43-
"Programming Language :: Python :: 2",
44-
"Programming Language :: Python :: 2.7",
4543
"Programming Language :: Python :: 3",
46-
"Programming Language :: Python :: 3.5",
44+
"Programming Language :: Python :: 3 :: Only"
4745
"Programming Language :: Python :: 3.6",
4846
"Programming Language :: Python :: 3.7",
4947
"Programming Language :: Python :: 3.8",
@@ -85,5 +83,5 @@ def get_version(rel_path):
8583
},
8684

8785
zip_safe=False,
88-
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
86+
python_requires='>=3.6',
8987
)

src/pip/_internal/cli/base_command.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import logging.config
77
import optparse
88
import os
9-
import platform
109
import sys
1110
import traceback
1211

@@ -139,35 +138,6 @@ def _main(self, args):
139138
user_log_file=options.log,
140139
)
141140

142-
if (
143-
sys.version_info[:2] == (2, 7) and
144-
not options.no_python_version_warning
145-
):
146-
message = (
147-
"pip 21.0 will drop support for Python 2.7 in January 2021. "
148-
"More details about Python 2 support in pip can be found at "
149-
"https://pip.pypa.io/en/latest/development/release-process/#python-2-support" # noqa
150-
)
151-
if platform.python_implementation() == "CPython":
152-
message = (
153-
"Python 2.7 reached the end of its life on January "
154-
"1st, 2020. Please upgrade your Python as Python 2.7 "
155-
"is no longer maintained. "
156-
) + message
157-
deprecated(message, replacement=None, gone_in="21.0")
158-
159-
if (
160-
sys.version_info[:2] == (3, 5) and
161-
not options.no_python_version_warning
162-
):
163-
message = (
164-
"Python 3.5 reached the end of its life on September "
165-
"13th, 2020. Please upgrade your Python as Python 3.5 "
166-
"is no longer maintained. pip 21.0 will drop support "
167-
"for Python 3.5 in January 2021."
168-
)
169-
deprecated(message, replacement=None, gone_in="21.0")
170-
171141
# TODO: Try to get these passing down from the command?
172142
# without resorting to os.environ to hold these.
173143
# This also affects isolated builds and it should.

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def in_memory_pip():
496496
@pytest.fixture(scope="session")
497497
def deprecated_python():
498498
"""Used to indicate whether pip deprecated this Python version"""
499-
return sys.version_info[:2] in [(2, 7), (3, 5)]
499+
return sys.version_info[:2] in []
500500

501501

502502
@pytest.fixture(scope="session")

0 commit comments

Comments
 (0)