From 17cbdcb53f51deacff2868b6f6ea4d6fadbfa9dd Mon Sep 17 00:00:00 2001 From: Tom Most Date: Thu, 2 Nov 2023 21:42:03 -0700 Subject: [PATCH 1/6] Run towncrier on Python 3.11 Towncrier 23.10.0 dropped support for Python 3.7. --- .github/workflows/ci.yaml | 2 +- tox.ini | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 04977594..77d4cd00 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.11' - uses: actions/cache@v3 with: diff --git a/tox.ini b/tox.ini index 2c308623..af9caddc 100644 --- a/tox.ini +++ b/tox.ini @@ -26,25 +26,27 @@ commands = {envbindir}/trial {posargs:treq} [testenv:flake8] +python = python3.11 skip_install = True deps = flake8 commands = flake8 src/treq/ [testenv:towncrier] -python = python3 +python = python3.11 deps = towncrier commands = towncrier {posargs:--draft} [testenv:twine] -python = python3 +python = python3.11 deps = twine commands = twine check {distdir}/*.* [testenv:check-manifest] +python = python3.11 deps = check-manifest commands = From a0a277fa85580a48ced0d4e678d56fe7b012bcec Mon Sep 17 00:00:00 2001 From: Tom Most Date: Thu, 2 Nov 2023 22:12:18 -0700 Subject: [PATCH 2/6] Ignore parallel coverage files --- .gitignore | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9b00e7b3..cf2c7eb2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,9 @@ dist /docs/html /.eggs MANIFEST -.coverage +/.coverage +/.coverage.* coverage htmlcov _trial_temp* -.tox +/.tox From ae2da9e9249500dafd3082ec307b06313f949ee6 Mon Sep 17 00:00:00 2001 From: Tom Most Date: Thu, 2 Nov 2023 21:52:27 -0700 Subject: [PATCH 3/6] Update Twisted and Python support matrix Twisted 23.10.0 dropped support for Python 3.7 and added support for Python 3.12. Twisted 23.8.0 added support for Python 3.11 and drops support for PyPy <3.9. Twisted 22.10.0 is our new lower bound for twisted/twisted#11635. Python 3.11 and 3.12 now exist. --- .github/workflows/ci.yaml | 33 ++++++++++++++++++++++++++++----- changelog.d/364.feature.rst | 1 + changelog.d/374.feature.rst | 1 + changelog.d/374.removal.rst | 3 +++ setup.py | 6 +++--- tox.ini | 8 ++++---- 6 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 changelog.d/364.feature.rst create mode 100644 changelog.d/374.feature.rst create mode 100644 changelog.d/374.removal.rst diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 77d4cd00..72af2347 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,7 @@ jobs: ${{ runner.os }}-pip-docs- ${{ runner.os }}-pip- - - run: python -m pip install tox + - run: python -m pip install 'tox<4' - run: tox -q -e docs @@ -63,15 +63,35 @@ jobs: continue-on-error: ${{ matrix.experimental }} strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.8", "pypy-3.9"] + # Python versions common to lowest and latest + python-version: ["3.8", "3.9", "3.10", "pypy-3.9"] twisted-version: ["lowest", "latest"] experimental: [false] include: - - python-version: "3.8" - twisted-version: "trunk" - experimental: true + # Pythons too old for latest + - python-version: "3.7" + twisted-version: "lowest" + experimental: false + + - python-version: "pypy-3.8" + twisted-version: "lowest" + experimental: false + + # Pythons too new for lowest + - python-version: "3.11" + twisted-version: "latest" + experimental: false + + - python-version: "3.12" + twisted-version: "latest" + experimental: false + + - python-version: "pypy-3.10" + twisted-version: "latest" + experimental: false + # Experimental trunk build - python-version: "3.9" twisted-version: "trunk" experimental: true @@ -101,8 +121,11 @@ jobs: "3.8": "py38", "3.9": "py39", "3.10": "py310", + "3.11": "py311", + "3.12": "py312", "pypy-3.8": "pypy3", "pypy-3.9": "pypy3", + "pypy-3.10": "pypy3", } factor = table["${{ matrix.python-version }}"] print("::set-output name=value::" + factor) diff --git a/changelog.d/364.feature.rst b/changelog.d/364.feature.rst new file mode 100644 index 00000000..e7f26571 --- /dev/null +++ b/changelog.d/364.feature.rst @@ -0,0 +1 @@ +Python 3.11 is now supported. diff --git a/changelog.d/374.feature.rst b/changelog.d/374.feature.rst new file mode 100644 index 00000000..573b64eb --- /dev/null +++ b/changelog.d/374.feature.rst @@ -0,0 +1 @@ +PyPy 3.10 is now supported. diff --git a/changelog.d/374.removal.rst b/changelog.d/374.removal.rst new file mode 100644 index 00000000..253961ca --- /dev/null +++ b/changelog.d/374.removal.rst @@ -0,0 +1,3 @@ +Support for PyPy 3.8, which has reached end of support, is deprecated. This is the last release with support for PyPy 3.8. + +The minimum supported Twisted version has increased to 22.10.0. Older versions are no longer tested in CI. diff --git a/setup.py b/setup.py index 83027633..fcf1891f 100644 --- a/setup.py +++ b/setup.py @@ -7,11 +7,11 @@ "Operating System :: OS Independent", "Framework :: Twisted", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] @@ -32,7 +32,7 @@ "incremental", "requests >= 2.1.0", "hyperlink >= 21.0.0", - "Twisted[tls] >= 18.7.0", + "Twisted[tls] >= 22.10.0", "attrs", ], extras_require={ diff --git a/tox.ini b/tox.ini index af9caddc..7d5eb933 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = py37-twisted_lowest, - {pypy3,py37,py38,py39,py310}-twisted_latest, - {pypy3,py37,py38,py39,py310}-twisted_trunk, + {pypy3,py38,py39,py310,py311,py312}-twisted_latest, + {pypy3,py38,py39,py310,py311,py312}-twisted_trunk, twine, check-manifest, flake8, docs, coverage-report isolated_build = true @@ -11,7 +11,7 @@ extras = dev deps = coverage - twisted_lowest: Twisted==18.7.0 + twisted_lowest: Twisted==22.10.0 twisted_latest: Twisted twisted_trunk: https://github.com/twisted/twisted/archive/trunk.zip setenv = @@ -60,7 +60,7 @@ commands = sphinx-build -b html . html [testenv:coverage-report] -depends = pypy3,py37,py38,py39 +depends = pypy3,py37,py38,py39,py310,py311,py312 commands = coverage combine coverage report From 0ff9c2b01c4e8b0e19795c99fafc14fa63153b9d Mon Sep 17 00:00:00 2001 From: Tom Most Date: Thu, 2 Nov 2023 22:58:31 -0700 Subject: [PATCH 4/6] Add treq-required check --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72af2347..8e256988 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -140,3 +140,28 @@ jobs: COVERALLS_REPO_TOKEN: 4nctuKHTnVtbdmty2FgdO3iiWm1nb7xc4 COVERALLS_FLAG_NAME: python_${{ matrix.python-version }}-twisted_${{ matrix.twisted-version }} COVERALLS_PARALLEL: true + + # Helper so that on GitHub repo settings we can configure to single job. + # Then required jobs can be updated directly form the code, + # without having to go the GitHub repo setting -> Protected branch + # and all the clicking. + treq-required: + runs-on: ubuntu-latest + timeout-minutes: 10 + if: always() + # Add here the jobs that should block the merge of a PR. + needs: + - lint + - docs + - test + steps: + - name: Require all successes + shell: python3 {0} + env: + RESULTS: ${{ toJSON(needs.*.result) }} + run: | + import json + import os + import sys + results = json.loads(os.environ["RESULTS"]) + sys.exit(0 if all(result == "success" for result in results) else 1) From 523d6dadc45c58624445db1a19aeb366e5ce855c Mon Sep 17 00:00:00 2001 From: Tom Most Date: Fri, 3 Nov 2023 21:54:32 -0700 Subject: [PATCH 5/6] Don't run treq-required when cancelled Co-authored-by: Adi Roiban --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8e256988..cb9ff4de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -148,7 +148,7 @@ jobs: treq-required: runs-on: ubuntu-latest timeout-minutes: 10 - if: always() + if: ${{ !cancelled() }} # Add here the jobs that should block the merge of a PR. needs: - lint From f009b38e106559e24651832d7f3962ac158f4697 Mon Sep 17 00:00:00 2001 From: Tom Most Date: Fri, 3 Nov 2023 21:56:49 -0700 Subject: [PATCH 6/6] Add release note for Python 3.12 support --- changelog.d/375.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/375.feature.rst diff --git a/changelog.d/375.feature.rst b/changelog.d/375.feature.rst new file mode 100644 index 00000000..24b2788f --- /dev/null +++ b/changelog.d/375.feature.rst @@ -0,0 +1 @@ +Python 3.12 is now supported.