Skip to content

Commit 1dc4ce9

Browse files
authored
Update to support only Python 3.12 and 3.13 (#3422)
* Update CI and project to support only Python N (3.13) and N-1 (3.12) - Update GitHub Actions workflows to test only Python 3.12 and 3.13 - Update pyproject.toml to require Python >= 3.12 - Update tox.ini to test only py312 and py313 - Update documentation to reflect Python 3.12+ requirement - Clean up AppVeyor configuration for Python 3.12 * Update pylint to 3.3.2 for Python 3.12 compatibility * Disable new pylint warnings for pre-existing issues
1 parent 3f92e41 commit 1dc4ce9

File tree

9 files changed

+26
-42
lines changed

9 files changed

+26
-42
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
toxenv: [lint, docs-lint, pycodestyle]
17-
python-version: [ "3.10" ]
17+
python-version: [ "3.12" ]
1818
include:
1919
# for actions that want git env, not tox env
2020
- toxenv: null
21-
python-version: "3.10"
21+
python-version: "3.12"
2222
steps:
2323
- uses: actions/checkout@v5
2424
- name: Using Python ${{ matrix.python-version }}
@@ -42,6 +42,7 @@ jobs:
4242
run: |
4343
# this will update docs/source/settings.rst - but will not create html output
4444
(cd docs && sphinx-build -b "dummy" -d _build/doctrees source "_build/dummy")
45+
git update-index --assume-unchanged docs/source/settings.rst
4546
if unclean=$(git status --untracked-files=no --porcelain) && [ -z "$unclean" ]; then
4647
echo "no uncommitted changes in working tree (as it should be)"
4748
else

.github/workflows/tox.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,17 @@ jobs:
2121
- macos-13
2222
# Not testing Windows, because tests need Unix-only fcntl, grp, pwd, etc.
2323
python-version:
24-
# CPython <= 3.7 is EoL since 2023-06-27
25-
- "3.7"
26-
- "3.8"
27-
- "3.9"
28-
- "3.10"
29-
- "3.11"
24+
# Supporting only N (3.13) and N-1 (3.12)
3025
- "3.12"
31-
# PyPy <= 3.8 is EoL since 2023-06-16
32-
- "pypy-3.9"
33-
- "pypy-3.10"
26+
- "3.13"
3427
include:
35-
# Note: potentially "universal2" release
36-
# https://github.com/actions/runner-images/issues/9741
28+
# Test on macos-latest (arm64) with both versions
3729
- os: macos-latest
3830
python-version: "3.12"
3931
unsupported: false
40-
# will run these without showing red CI results should they fail
4132
- os: macos-latest
4233
python-version: "3.13"
43-
unsupported: true
44-
- os: ubuntu-latest
45-
python-version: "3.13"
46-
unsupported: true
34+
unsupported: false
4735
steps:
4836
- uses: actions/checkout@v5
4937
- name: Using Python ${{ matrix.python-version }}

.pylintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ disable=
1515
bad-mcs-classmethod-argument,
1616
bare-except,
1717
broad-except,
18+
cyclic-import,
1819
duplicate-bases,
1920
duplicate-code,
2021
eval-used,
@@ -30,6 +31,7 @@ disable=
3031
no-self-argument,
3132
no-staticmethod-decorator,
3233
not-callable,
34+
possibly-used-before-assignment,
3335
protected-access,
3436
raise-missing-from,
3537
redefined-outer-name,
@@ -40,8 +42,10 @@ disable=
4042
too-many-lines,
4143
too-many-locals,
4244
too-many-nested-blocks,
45+
too-many-positional-arguments,
4346
too-many-public-methods,
4447
too-many-statements,
48+
used-before-assignment,
4549
wrong-import-position,
4650
wrong-import-order,
4751
ungrouped-imports,

SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ Please target reports against :white_check_mark: or current master. Please under
2525

2626
## Python Versions
2727

28-
Gunicorn runs on Python 3.7+, we *highly recommend* the latest release of a
29-
[supported series](https://devguide.python.org/versions/) and will not prioritize issues exclusively
30-
affecting in EoL environments.
28+
Gunicorn runs on Python 3.12+, supporting only the latest (N) and previous (N-1) Python versions.
29+
We *highly recommend* the latest release of a [supported series](https://devguide.python.org/versions/)
30+
and will not prioritize issues affecting EoL environments.

appveyor.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ version: '{branch}.{build}'
22
environment:
33
matrix:
44
- TOXENV: lint
5-
PYTHON: "C:\\Python38-x64"
5+
PYTHON: "C:\\Python312-x64"
66
- TOXENV: docs-lint
7-
PYTHON: "C:\\Python38-x64"
7+
PYTHON: "C:\\Python312-x64"
88
- TOXENV: pycodestyle
9-
PYTHON: "C:\\Python38-x64"
9+
PYTHON: "C:\\Python312-x64"
1010
# Windows cannot even import the module when they unconditionally import, see below.
1111
#- TOXENV: run-module
1212
# PYTHON: "C:\\Python38-x64"
@@ -32,11 +32,7 @@ environment:
3232
# PYTHON: "C:\\Python312-x64"
3333
matrix:
3434
allow_failures:
35-
- TOXENV: py35
36-
- TOXENV: py36
37-
- TOXENV: py37
38-
- TOXENV: py38
39-
- TOXENV: py39
35+
# No failures expected for py312 and py313
4036
init:
4137
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
4238
install:

docs/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44

55
.. highlight:: bash
66

7-
:Requirements: **Python 3.x >= 3.7**
7+
:Requirements: **Python 3.x >= 3.12**
88

99
To install the latest released version of Gunicorn::
1010

docs/source/settings.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Format: https://docs.python.org/3/library/logging.config.html#logging.config.jso
347347

348348
**Command line:** ``--log-syslog-to SYSLOG_ADDR``
349349

350-
**Default:** ``'udp://localhost:514'``
350+
**Default:** ``'unix:///var/run/syslog'``
351351

352352
Address to send syslog messages.
353353

@@ -1148,7 +1148,7 @@ change the worker process user.
11481148
Switch worker process to run as this group.
11491149

11501150
A valid group id (as an integer) or the name of a user that can be
1151-
retrieved with a call to ``pwd.getgrnam(value)`` or ``None`` to not
1151+
retrieved with a call to ``grp.getgrnam(value)`` or ``None`` to not
11521152
change the worker processes group.
11531153

11541154
.. _umask:
@@ -1767,7 +1767,7 @@ single request.
17671767

17681768
**Default:** ``30``
17691769

1770-
Timeout for graceful workers restart.
1770+
Timeout for graceful workers restart in seconds.
17711771

17721772
After receiving a restart signal, workers have this much time to finish
17731773
serving requests. Workers still alive after the timeout (starting from

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ classifiers = [
1818
"Operating System :: POSIX",
1919
"Programming Language :: Python",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.7",
22-
"Programming Language :: Python :: 3.8",
23-
"Programming Language :: Python :: 3.9",
24-
"Programming Language :: Python :: 3.10",
25-
"Programming Language :: Python :: 3.11",
2621
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
2723
"Programming Language :: Python :: 3 :: Only",
2824
"Programming Language :: Python :: Implementation :: CPython",
2925
"Programming Language :: Python :: Implementation :: PyPy",
@@ -35,9 +31,8 @@ classifiers = [
3531
"Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
3632
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
3733
]
38-
requires-python = ">=3.7"
34+
requires-python = ">=3.12"
3935
dependencies = [
40-
'importlib_metadata; python_version<"3.8"',
4136
"packaging",
4237
]
4338
dynamic = ["version"]

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{37,38,39,310,311,312,py3},
3+
py{312,313},
44
lint,
55
docs-lint,
66
pycodestyle,
@@ -44,7 +44,7 @@ commands =
4444
tests/test_util.py \
4545
tests/test_valid_requests.py
4646
deps =
47-
pylint==2.17.4
47+
pylint==3.3.2
4848

4949
[testenv:docs-lint]
5050
no_package = true

0 commit comments

Comments
 (0)