From afe068021215d99083a84261dcba4e5dc61b4b8a Mon Sep 17 00:00:00 2001 From: Ben Cail Date: Mon, 23 Oct 2023 16:58:12 -0400 Subject: [PATCH 01/10] Document Python 3.7 requirement --- README.rst | 2 +- docs/source/index.rst | 2 +- docs/source/install.rst | 2 +- setup.py | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index fe9523b9a..4a4029dd3 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ The documentation is hosted at https://docs.gunicorn.org. Installation ------------ -Gunicorn requires **Python 3.x >= 3.5**. +Gunicorn requires **Python 3.x >= 3.7**. Install from PyPI:: diff --git a/docs/source/index.rst b/docs/source/index.rst index 24c4814d2..3f89ce1eb 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -23,7 +23,7 @@ Features * Simple Python configuration * Multiple worker configurations * Various server hooks for extensibility -* Compatible with Python 3.x >= 3.5 +* Compatible with Python 3.x >= 3.7 Contents diff --git a/docs/source/install.rst b/docs/source/install.rst index 66f2479e7..2367086df 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -4,7 +4,7 @@ Installation .. highlight:: bash -:Requirements: **Python 3.x >= 3.5** +:Requirements: **Python 3.x >= 3.7** To install the latest released version of Gunicorn:: diff --git a/setup.py b/setup.py index dffd418cf..0d73584d2 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,6 @@ 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', @@ -100,7 +98,7 @@ def run_tests(self): 'Source code': 'https://github.com/benoitc/gunicorn', }, - python_requires='>=3.5', + python_requires='>=3.7', install_requires=install_requires, classifiers=CLASSIFIERS, zip_safe=False, From 4ce82358e88357982676153c0141236d32c1d36b Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Tue, 31 Oct 2023 08:42:48 +0100 Subject: [PATCH 02/10] Add Python 3.12 to test matrix and add classifiers --- .github/workflows/tox.yml | 2 +- setup.py | 1 + tox.ini | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index d253148f5..2c0d737da 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc. - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8" ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8" ] steps: - uses: actions/checkout@v4 - name: Using Python ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index dffd418cf..77413acd0 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', diff --git a/tox.ini b/tox.ini index a7b7d38c6..aedd522fd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39,310,311,py3}, lint, docs-lint, pycodestyle +envlist = py{37,38,39,310,311,312,py3}, lint, docs-lint, pycodestyle skipsdist = false ; Can't set skipsdist and use_develop in tox v4 to true due to https://github.com/tox-dev/tox/issues/2730 From 0bb96d17c584be1a483a106098d5a40d17073b64 Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Thu, 28 Dec 2023 21:21:01 +0100 Subject: [PATCH 03/10] CI: tests may hang on PyPy --- .github/workflows/tox.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 84e322fe5..eef5595c4 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -8,6 +8,8 @@ env: jobs: tox: name: ${{ matrix.os }} / ${{ matrix.python-version }} + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes + timeout-minutes: 10 runs-on: ${{ matrix.os }} strategy: fail-fast: false From b39c5b7ebb31a9db24db3805ddbc7f2dbbf676e1 Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Thu, 28 Dec 2023 21:24:20 +0100 Subject: [PATCH 04/10] CI: style --- .github/workflows/tox.yml | 11 ++++++++++- tox.ini | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index eef5595c4..29e09afc0 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -15,7 +15,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc. - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8" ] + python-version: + # CPython <= 3.7 is EoL since 2923-06-27 + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + # PyPy <= 3.8 is EoL since 2023-06-16 + - "pypy-3.8" steps: - uses: actions/checkout@v4 - name: Using Python ${{ matrix.python-version }} diff --git a/tox.ini b/tox.ini index 4d4c19cd4..c1c2fd053 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,11 @@ [tox] -envlist = py{37,38,39,310,311,312,py3}, lint, docs-lint, pycodestyle, run-entrypoint, run-module +envlist = + py{37,38,39,310,311,312,py3}, + lint, + docs-lint, + pycodestyle, + run-entrypoint, + run-module, skipsdist = false ; Can't set skipsdist and use_develop in tox v4 to true due to https://github.com/tox-dev/tox/issues/2730 From 184e36f9dae7065d91e35ae1700dcbf4c556b7c2 Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Fri, 8 Dec 2023 01:29:54 +0100 Subject: [PATCH 05/10] skip eventlet, not yet supported on python 3.12 will work again, should still be reverted when stdlib conflict resolved in eventlet --- tests/workers/test_geventlet.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/workers/test_geventlet.py b/tests/workers/test_geventlet.py index 815dcec34..06c7b5305 100644 --- a/tests/workers/test_geventlet.py +++ b/tests/workers/test_geventlet.py @@ -3,5 +3,15 @@ # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. +import pytest +import sys + def test_import(): + + try: + import eventlet + except AttributeError: + if (3,13) > sys.version_info >= (3, 12): + pytest.skip("Ignoring eventlet failures on Python 3.12") + raise __import__('gunicorn.workers.geventlet') From 89dcc5c5781ae27d14b8b14ccc4a70038a11989a Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Thu, 28 Dec 2023 21:31:10 +0100 Subject: [PATCH 06/10] CI: stop testing EoL PyPy --- .github/workflows/tox.yml | 5 +++-- appveyor.yml | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 29e09afc0..72d9884c5 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -16,7 +16,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc. python-version: - # CPython <= 3.7 is EoL since 2923-06-27 + # CPython <= 3.7 is EoL since 2023-06-27 - "3.7" - "3.8" - "3.9" @@ -24,7 +24,8 @@ jobs: - "3.11" - "3.12" # PyPy <= 3.8 is EoL since 2023-06-16 - - "pypy-3.8" + - "pypy-3.9" + - "pypy-3.10" steps: - uses: actions/checkout@v4 - name: Using Python ${{ matrix.python-version }} diff --git a/appveyor.yml b/appveyor.yml index 85feb4dc3..3cf11f0e9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,6 +24,12 @@ environment: # PYTHON: "C:\\Python38-x64" #- TOXENV: py39 # PYTHON: "C:\\Python39-x64" + #- TOXENV: py310 + # PYTHON: "C:\\Python310-x64" + #- TOXENV: py311 + # PYTHON: "C:\\Python311-x64" + #- TOXENV: py312 + # PYTHON: "C:\\Python312-x64" matrix: allow_failures: - TOXENV: py35 From 481c3f9522edc58806a3efc5b49be4f202cc7700 Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Fri, 8 Dec 2023 07:02:46 +0100 Subject: [PATCH 07/10] remove setup.cfg - overridden by pyproject.toml --- requirements_test.txt | 2 +- setup.cfg | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 setup.cfg diff --git a/requirements_test.txt b/requirements_test.txt index fad22e315..b618d1a73 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,5 +1,5 @@ gevent eventlet coverage -pytest +pytest>=7.2.0 pytest-cov diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 07322e337..000000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[tool:pytest] -norecursedirs = examples lib local src -testpaths = tests/ -addopts = --assert=plain --cov=gunicorn --cov-report=xml From 5e30bfa6b1a3e1f2bde7feb514d1734d28f39231 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 16 Jul 2021 11:48:16 +0100 Subject: [PATCH 08/10] add changelog to project.urls (updated for PEP621) --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 0dabe03fe..f4ac02e99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = ["setuptools>=61.2"] build-backend = "setuptools.build_meta" [project] +# see https://packaging.python.org/en/latest/specifications/pyproject-toml/ name = "gunicorn" authors = [{name = "Benoit Chesneau", email = "benoitc@gunicorn.org"}] license = {text = "MIT"} @@ -46,6 +47,7 @@ Homepage = "https://gunicorn.org" Documentation = "https://docs.gunicorn.org" "Issue tracker" = "https://github.com/benoitc/gunicorn/issues" "Source code" = "https://github.com/benoitc/gunicorn" +Changelog = "https://docs.gunicorn.org/en/stable/news.html" [project.optional-dependencies] gevent = ["gevent>=1.4.0"] From f4703824c323fe6867dce0e2f11013b8de319353 Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Thu, 28 Dec 2023 21:36:51 +0100 Subject: [PATCH 09/10] docs: promise 3.12 compat --- docs/source/2023-news.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/2023-news.rst b/docs/source/2023-news.rst index 971cfef38..c26071580 100644 --- a/docs/source/2023-news.rst +++ b/docs/source/2023-news.rst @@ -10,9 +10,11 @@ Changelog - 2023 - on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits) - requests conflicting configured or passed SCRIPT_NAME now produce a verbose error - Trailer fields are no longer inspected for headers indicating secure scheme +- support Python 3.12 ** Breaking changes ** +- minimum version is Python 3.7 - the limitations on valid characters in the HTTP method have been bounded to Internet Standards - requests specifying unsupported transfer coding (order) are refused by default (rare) - HTTP methods are no longer casefolded by default (IANA method registry contains none affacted) From deae2fc4c5f93bfce59be5363055d4cd4ab1b0b6 Mon Sep 17 00:00:00 2001 From: "Paul J. Dorn" Date: Fri, 29 Dec 2023 05:35:32 +0100 Subject: [PATCH 10/10] CI: back off the agressive timeout Precise number does not matter that much, so lets not stop potentially working tests. The point was to cut off well before 6 hours, so any small number will do. --- .github/workflows/tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 72d9884c5..308fab11a 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -9,7 +9,7 @@ jobs: tox: name: ${{ matrix.os }} / ${{ matrix.python-version }} # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes - timeout-minutes: 10 + timeout-minutes: 20 runs-on: ${{ matrix.os }} strategy: fail-fast: false