diff --git a/.azure-pipelines/jobs/test-windows.yml b/.azure-pipelines/jobs/test-windows.yml index 6053b0eb005..99cd8a836bd 100644 --- a/.azure-pipelines/jobs/test-windows.yml +++ b/.azure-pipelines/jobs/test-windows.yml @@ -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 diff --git a/.azure-pipelines/jobs/test.yml b/.azure-pipelines/jobs/test.yml index 274e075a69b..a3a0ef80b6d 100644 --- a/.azure-pipelines/jobs/test.yml +++ b/.azure-pipelines/jobs/test.yml @@ -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 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5d7b9acab87..c7afa8d35ea 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 165d2ef1540..6610b6eb019 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index 5befb316a4d..5c33231b1b2 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -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 | | | +-----------+----------+-------+---------------+-----------------+ diff --git a/docs/html/development/release-process.rst b/docs/html/development/release-process.rst index 91ce3e23379..17d11e7d1cf 100644 --- a/docs/html/development/release-process.rst +++ b/docs/html/development/release-process.rst @@ -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 --------------------- diff --git a/docs/html/installing.rst b/docs/html/installing.rst index a49aebea4a3..9e2c7051ef3 100644 --- a/docs/html/installing.rst +++ b/docs/html/installing.rst @@ -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. diff --git a/news/6148.removal.rst b/news/6148.removal.rst new file mode 100644 index 00000000000..cf6d85e70ba --- /dev/null +++ b/news/6148.removal.rst @@ -0,0 +1 @@ +Drop support for Python 2. diff --git a/news/9189.removal.rst b/news/9189.removal.rst new file mode 100644 index 00000000000..79928cbb15a --- /dev/null +++ b/news/9189.removal.rst @@ -0,0 +1 @@ +Drop support for Python 3.5. diff --git a/noxfile.py b/noxfile.py index 29e3959e463..b94cfe86fe7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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(): diff --git a/setup.py b/setup.py index 2601d8bd912..b7d0e8f51d7 100644 --- a/setup.py +++ b/setup.py @@ -40,10 +40,8 @@ def get_version(rel_path): "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 @@ def get_version(rel_path): }, zip_safe=False, - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*', + python_requires='>=3.6', ) diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index 7f05efb85db..ce93552b3c1 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -6,7 +6,6 @@ import logging.config import optparse import os -import platform import sys import traceback @@ -139,35 +138,6 @@ def _main(self, args): 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. diff --git a/tests/conftest.py b/tests/conftest.py index dc1fdb5140f..78be52788a1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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")