Skip to content

Commit

Permalink
Merge pull request #9189 from pradyunsg/drop-old-python-support
Browse files Browse the repository at this point in the history
Drop support for Python 2.7 and Python 3.5
  • Loading branch information
pradyunsg authored Dec 20, 2020
2 parents 726b66f + c7a7206 commit be9637f
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 114 deletions.
16 changes: 2 additions & 14 deletions .azure-pipelines/jobs/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions .azure-pipelines/jobs/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 0 additions & 38 deletions docs/html/development/ci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -95,87 +92,52 @@ Actual testing
+------------------------------+---------------+-----------------+
| **interpreter** | **unit** | **integration** |
+-----------+----------+-------+---------------+-----------------+
| | | CP2.7 | Azure | Azure |
| | +-------+---------------+-----------------+
| | | CP3.5 | Azure | |
| | +-------+---------------+-----------------+
| | | CP3.6 | Azure | |
| | +-------+---------------+-----------------+
| | x86 | CP3.7 | Azure | |
| | +-------+---------------+-----------------+
| | | 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 | | |
+-----------+----------+-------+---------------+-----------------+
13 changes: 3 additions & 10 deletions docs/html/development/release-process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/html/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions news/6148.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop support for Python 2.
1 change: 1 addition & 0 deletions news/9189.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop support for Python 3.5.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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',
)
30 changes: 0 additions & 30 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging.config
import optparse
import os
import platform
import sys
import traceback

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit be9637f

Please sign in to comment.