Merge pull request #9189 from pradyunsg/drop-old-python-support

Drop support for Python 2.7 and Python 3.5
This commit is contained in:
Pradyun Gedam 2020-12-20 18:57:41 +00:00 committed by GitHub
commit be9637f7f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 17 additions and 114 deletions

View File

@ -9,14 +9,8 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
"2.7-x86":
python.version: '2.7'
python.architecture: x86
"2.7": # because Python 2!
python.version: '2.7'
python.architecture: x64
"3.5": # lowest Py3 version
python.version: '3.5'
"3.6": # lowest Python version
python.version: '3.6'
python.architecture: x64
"3.8": # current
python.version: '3.8'
@ -38,16 +32,10 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
"3.6":
python.version: '3.6'
python.architecture: x64
"3.7":
python.version: '3.7'
python.architecture: x64
# This is for Windows, so test x86 builds
"3.5-x86":
python.version: '3.5'
python.architecture: x86
"3.6-x86":
python.version: '3.6'
python.architecture: x86

View File

@ -9,8 +9,8 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
"2.7":
python.version: '2.7'
"3.6": # lowest Python version
python.version: '3.6'
python.architecture: x64
"3.8":
python.version: '3.8'
@ -29,12 +29,6 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
"3.5":
python.version: '3.5'
python.architecture: x64
"3.6":
python.version: '3.6'
python.architecture: x64
"3.7":
python.version: '3.7'
python.architecture: x64

View File

@ -91,7 +91,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
python: [3.6, 3.7, 3.8, 3.9]
steps:
# Caches

View File

@ -23,13 +23,9 @@ jobs:
# PyPy
- stage: secondary
env: GROUP=1
python: pypy3.5-7.0.0
python: pypy3.6-7.3.1
- env: GROUP=2
python: pypy3.5-7.0.0
- env: GROUP=1
python: pypy2.7-7.1.1
- env: GROUP=2
python: pypy2.7-7.1.1
python: pypy3.6-7.3.1
before_install: tools/travis/setup.sh
install: travis_retry tools/travis/install.sh

View File

@ -17,12 +17,9 @@ Supported interpreters
pip support a variety of Python interpreters:
- CPython 2.7
- CPython 3.5
- CPython 3.6
- CPython 3.7
- CPython 3.8
- Latest PyPy
- Latest PyPy3
on different operating systems:
@ -95,9 +92,6 @@ Actual testing
+------------------------------+---------------+-----------------+
| **interpreter** | **unit** | **integration** |
+-----------+----------+-------+---------------+-----------------+
| | | CP2.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.5 | Azure | |
| | +-------+---------------+-----------------+
| | | CP3.6 | Azure | |
| | +-------+---------------+-----------------+
@ -105,77 +99,45 @@ Actual testing
| | +-------+---------------+-----------------+
| | | CP3.8 | Azure | |
| | +-------+---------------+-----------------+
| | | PyPy | | |
| | +-------+---------------+-----------------+
| | | PyPy3 | | |
| Windows +----------+-------+---------------+-----------------+
| | | CP2.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.5 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.6 | Azure | |
| | +-------+---------------+-----------------+
| | x64 | CP3.7 | Azure | |
| | +-------+---------------+-----------------+
| | | CP3.8 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | PyPy | | |
| | +-------+---------------+-----------------+
| | | PyPy3 | | |
+-----------+----------+-------+---------------+-----------------+
| | | CP2.7 | | |
| | +-------+---------------+-----------------+
| | | CP3.5 | | |
| | +-------+---------------+-----------------+
| | | CP3.6 | | |
| | +-------+---------------+-----------------+
| | x86 | CP3.7 | | |
| | +-------+---------------+-----------------+
| | | CP3.8 | | |
| | +-------+---------------+-----------------+
| | | PyPy | | |
| | +-------+---------------+-----------------+
| | | PyPy3 | | |
| Linux +----------+-------+---------------+-----------------+
| | | CP2.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.5 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.6 | Azure | Azure |
| | +-------+---------------+-----------------+
| | x64 | CP3.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.8 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | PyPy | Travis | Travis |
| | +-------+---------------+-----------------+
| | | PyPy3 | Travis | Travis |
+-----------+----------+-------+---------------+-----------------+
| | | CP2.7 | | |
| | +-------+---------------+-----------------+
| | | CP3.5 | | |
| | +-------+---------------+-----------------+
| | | CP3.6 | | |
| | +-------+---------------+-----------------+
| | x86 | CP3.7 | | |
| | +-------+---------------+-----------------+
| | | CP3.8 | | |
| | +-------+---------------+-----------------+
| | | PyPy | | |
| | +-------+---------------+-----------------+
| | | PyPy3 | | |
| MacOS +----------+-------+---------------+-----------------+
| | | CP2.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.5 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.6 | Azure | Azure |
| | +-------+---------------+-----------------+
| | x64 | CP3.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.8 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | PyPy | | |
| | +-------+---------------+-----------------+
| | | PyPy3 | | |
+-----------+----------+-------+---------------+-----------------+

View File

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

View File

@ -206,7 +206,7 @@ Upgrading pip
Python and OS Compatibility
===========================
pip works with CPython versions 2.7, 3.5, 3.6, 3.7, 3.8 and also PyPy.
pip works with CPython versions 3.6, 3.7, 3.8 and also PyPy.
This means pip works on the latest patch version of each of these minor
versions. Previous patch versions are supported on a best effort approach.

1
news/6148.removal.rst Normal file
View File

@ -0,0 +1 @@
Drop support for Python 2.

1
news/9189.removal.rst Normal file
View File

@ -0,0 +1 @@
Drop support for Python 3.5.

View File

@ -70,7 +70,7 @@ def should_update_common_wheels():
# completely to nox for all our automation. Contributors should prefer using
# `tox -e ...` until this note is removed.
# -----------------------------------------------------------------------------
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy", "pypy3"])
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "pypy3"])
def test(session):
# Get the common wheels.
if should_update_common_wheels():

View File

@ -40,10 +40,8 @@ setup(
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Build Tools",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3 :: Only"
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
@ -85,5 +83,5 @@ setup(
},
zip_safe=False,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
python_requires='>=3.6',
)

View File

@ -6,7 +6,6 @@ import logging
import logging.config
import optparse
import os
import platform
import sys
import traceback
@ -139,35 +138,6 @@ class Command(CommandContextMixIn):
user_log_file=options.log,
)
if (
sys.version_info[:2] == (2, 7) and
not options.no_python_version_warning
):
message = (
"pip 21.0 will drop support for Python 2.7 in January 2021. "
"More details about Python 2 support in pip can be found at "
"https://pip.pypa.io/en/latest/development/release-process/#python-2-support" # noqa
)
if platform.python_implementation() == "CPython":
message = (
"Python 2.7 reached the end of its life on January "
"1st, 2020. Please upgrade your Python as Python 2.7 "
"is no longer maintained. "
) + message
deprecated(message, replacement=None, gone_in="21.0")
if (
sys.version_info[:2] == (3, 5) and
not options.no_python_version_warning
):
message = (
"Python 3.5 reached the end of its life on September "
"13th, 2020. Please upgrade your Python as Python 3.5 "
"is no longer maintained. pip 21.0 will drop support "
"for Python 3.5 in January 2021."
)
deprecated(message, replacement=None, gone_in="21.0")
# TODO: Try to get these passing down from the command?
# without resorting to os.environ to hold these.
# This also affects isolated builds and it should.

View File

@ -496,7 +496,7 @@ def in_memory_pip():
@pytest.fixture(scope="session")
def deprecated_python():
"""Used to indicate whether pip deprecated this Python version"""
return sys.version_info[:2] in [(2, 7), (3, 5)]
return sys.version_info[:2] in []
@pytest.fixture(scope="session")