Drop support for Python 3.9 (#7196)

This commit is contained in:
Nate Prewitt
2026-02-06 08:02:46 -07:00
committed by GitHub
parent 32e26af3af
commit 0c2bbe7398
5 changed files with 11 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15-dev", "pypy-3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15-dev", "pypy-3.11"]
os: [ubuntu-22.04, macOS-latest, windows-latest]
# Pypy-3.11 can't install openssl-sys with rust
# which prevents us from testing in GHA.
@@ -45,10 +45,10 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: 'Set up Python 3.9'
- name: 'Set up Python 3.10'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.9'
python-version: '3.10'
- name: Install dependencies
run: |
make
@@ -65,10 +65,10 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: 'Set up Python 3.9'
- name: 'Set up Python 3.10'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: '3.9'
python-version: '3.10'
- name: Install dependencies
run: |
make

View File

@@ -33,7 +33,7 @@ Requests is available on PyPI:
$ python -m pip install requests
```
Requests officially supports Python 3.9+.
Requests officially supports Python 3.10+.
## Supported Features & BestPractices

View File

@@ -14,7 +14,7 @@ maintainers = [
{name = "Ian Stapleton Cordasco", email="graffatcolmingov@gmail.com"},
{name = "Nate Prewitt", email="nate.prewitt@gmail.com"}
]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"charset_normalizer>=2,<4",
"idna>=2.5,<4",
@@ -32,7 +32,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@@ -85,8 +84,7 @@ select = [
"UP", # pyupgrade
"T10", # flake8-debugger (replaces debug-statements hook)
]
# UP036: Remove once Python 3.10 is the minimum supported version
ignore = ["E203", "E501", "UP038", "UP031", "UP036"]
ignore = ["E203", "E501", "UP038", "UP031"]
per-file-ignores = {"src/requests/__init__.py" = ["E402", "F401"], "src/requests/compat.py" = ["E402", "F401"], "tests/compat.py" = ["F401"]}
[tool.ruff.lint.isort]

View File

@@ -1,7 +1,7 @@
import sys
if sys.version_info < (3, 9):
sys.stderr.write("Requests requires Python 3.9 or later.\n")
if sys.version_info < (3, 10): # noqa: UP036
sys.stderr.write("Requests requires Python 3.10 or later.\n")
sys.exit(1)
from setuptools import setup

View File

@@ -1,5 +1,5 @@
[tox]
envlist = py{39,310,311,312,313,314}-{default, use_chardet_on_py3}
envlist = py{310,311,312,313,314}-{default, use_chardet_on_py3}
[testenv]
deps = -rrequirements-dev.txt