Skip to content

Commit f57ab6f

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into sql-storage
2 parents 560480e + 93ef0bf commit f57ab6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+553
-268
lines changed

.coveragerc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
branch = True
33
parallel = True
44
source = klein
5-
omit = src/klein/test/typing_*.py
5+
omit = */klein/test/typing_*.py
66

77
[paths]
88
source=
99
src/klein
10-
.tox/*/lib/python*/site-packages/klein
10+
.tox/*/lib/py*/site-packages/klein
1111
.tox/*/Lib/site-packages/klein
12-
.tox/pypy*/site-packages/klein
1312

1413
[report]
1514
exclude_lines =
1615
pragma: no cover
1716
if TYPE_CHECKING:
17+
\s*\.\.\.$

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,8 @@ extend-ignore =
100100
B907,
101101
D419,
102102
N818,
103+
104+
# flake8 incorrectly identifies black folding '...' onto one line as
105+
# 'multiple statements'. See
106+
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#e701-e704
107+
E704, E701,

.github/workflows/cicd.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v4
2929

3030
- name: Install Python
31-
uses: actions/setup-python@v4
31+
uses: actions/setup-python@v5
3232
with:
3333
python-version: "3.11"
3434

@@ -62,7 +62,7 @@ jobs:
6262
uses: actions/checkout@v4
6363

6464
- name: Install Python
65-
uses: actions/setup-python@v4
65+
uses: actions/setup-python@v5
6666
with:
6767
python-version: "3.11"
6868

@@ -96,7 +96,7 @@ jobs:
9696
uses: actions/checkout@v4
9797

9898
- name: Install Python
99-
uses: actions/setup-python@v4
99+
uses: actions/setup-python@v5
100100
with:
101101
python-version: "3.11"
102102

@@ -130,7 +130,7 @@ jobs:
130130
uses: actions/checkout@v4
131131

132132
- name: Install Python
133-
uses: actions/setup-python@v4
133+
uses: actions/setup-python@v5
134134
with:
135135
python-version: "3.11"
136136

@@ -163,7 +163,7 @@ jobs:
163163
uses: actions/checkout@v4
164164

165165
- name: Install Python
166-
uses: actions/setup-python@v4
166+
uses: actions/setup-python@v5
167167
with:
168168
python-version: "3.11"
169169

@@ -193,27 +193,31 @@ jobs:
193193
strategy:
194194
matrix:
195195
os: ["ubuntu-latest"]
196-
python-version: ["3.7", "3.9", "3.10", "3.11"]
197-
twisted-version: ["21.2", "22.1", "current"]
196+
python-version: ["3.9", "3.10", "3.11"]
197+
twisted-version: ["21.2", "22.1", "23.8"]
198198
tox-prefix: ["coverage"]
199199
optional: [false]
200200
include:
201201
- os: "ubuntu-latest"
202-
python-version: "pypy-3.8"
203-
twisted-version: "current"
202+
python-version: "pypy-3.9"
203+
twisted-version: "23.8"
204204
tox-prefix: "test"
205205
optional: false
206206
- os: "ubuntu-latest"
207-
python-version: "pypy-3.9"
208-
twisted-version: "current"
207+
python-version: "pypy-3.10"
208+
twisted-version: "23.8"
209+
tox-prefix: "test"
210+
optional: false
211+
- os: "ubuntu-latest"
212+
python-version: "3.12.0"
213+
twisted-version: "23.8"
209214
tox-prefix: "test"
210215
optional: false
211-
# Test Python 3.12 but allow it to fail
212216
- os: "ubuntu-latest"
213-
python-version: "3.12.0-alpha.7"
214-
twisted-version: "current"
217+
python-version: "3.13.0"
218+
twisted-version: "24.10"
215219
tox-prefix: "test"
216-
optional: true
220+
optional: false
217221

218222
steps:
219223

@@ -223,7 +227,7 @@ jobs:
223227
fetch-depth: 2
224228

225229
- name: Install Python
226-
uses: actions/setup-python@v4
230+
uses: actions/setup-python@v5
227231
with:
228232
python-version: ${{ matrix.python-version }}
229233

@@ -266,19 +270,19 @@ jobs:
266270

267271
- name: Upload Trial log artifact
268272
if: ${{ failure() }}
269-
uses: actions/upload-artifact@v3
273+
uses: actions/upload-artifact@v4
270274
with:
271-
name: trial
275+
name: "trial-py${{ matrix.python-version }}-twisted${{ matrix.twisted-version }}-os${{ matrix.os }}"
272276
path: .tox/${TOX_ENV}/log/trial.log
273277

274278
# Use the latest supported Python version for combining coverage to
275279
# prevent parsing errors in older versions when looking at modern code.
276-
- uses: "actions/setup-python@v4"
280+
- uses: "actions/setup-python@v5"
277281
with:
278282
python-version: "3.11"
279283

280284
- name: "Upload coverage to Codecov"
281-
uses: "codecov/codecov-action@v3"
285+
uses: "codecov/codecov-action@v5"
282286
if: ${{ matrix.tox-prefix == 'coverage' }}
283287
with:
284288
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
/htmldocs/
1212
/src/*.egg-info
1313
coverage.xml
14+
*/__pycache__/*

.pre-commit-config.yaml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ ci:
55
repos:
66

77
- repo: https://github.com/asottile/pyupgrade
8-
rev: "v3.4.0"
8+
rev: "v3.20.0"
99
hooks:
1010
- id: pyupgrade
1111
args: ["--py37-plus", "--keep-runtime-typing"]
1212

1313
- repo: https://github.com/psf/black
14-
rev: "23.3.0"
14+
rev: "25.1.0"
1515
hooks:
1616
- id: black
17-
args: ["--target-version", "py37"]
1817

1918
- repo: https://github.com/PyCQA/autoflake
20-
rev: "v2.1.1"
19+
rev: "v2.3.1"
2120
hooks:
2221
- id: autoflake
2322
args:
@@ -28,41 +27,47 @@ repos:
2827
- --remove-unused-variables
2928

3029
- repo: https://github.com/PyCQA/flake8
31-
rev: "6.0.0"
30+
rev: "7.2.0"
3231
hooks:
3332
- id: flake8
3433
additional_dependencies:
35-
- flake8-bugbear==23.5.9
36-
- flake8-docstrings==1.7.0
37-
- flake8-mutable==1.2.0
38-
- flake8-pep3101==2.0.0
39-
- pep8-naming==0.13.3
40-
- pycodestyle==2.10.0
41-
- pydocstyle==6.3.0
42-
- pyflakes==3.0.1
34+
# duplicated because pre-commit cannot manage dependencies normally;
35+
# see https://github.com/pre-commit/pre-commit/issues/730 - for now,
36+
# paste and reformat from requirements/flake8.txt manually
37+
38+
- "flake8-bugbear==24.12.12"
39+
- "flake8-docstrings==1.7.0"
40+
- "flake8-mutable==1.2.0"
41+
- "flake8-pep3101==2.1.0"
42+
- "pep8-naming==0.14.1"
43+
- "pycodestyle==2.13.0"
44+
- "pydocstyle==6.3.0"
45+
- "pyflakes==3.3.2"
4346

4447
- repo: https://github.com/asottile/yesqa
45-
rev: "v1.4.0"
48+
rev: "v1.5.0"
4649
hooks:
4750
- id: yesqa
4851
additional_dependencies:
49-
- flake8-bugbear==23.3.23
50-
- flake8-docstrings==1.7.0
51-
- flake8-mutable==1.2.0
52-
- flake8-pep3101==2.0.0
53-
- pep8-naming==0.13.3
54-
- pycodestyle==2.10.0
55-
- pydocstyle==6.3.0
56-
- pyflakes==3.0.1
52+
# see 'duplicated' above
53+
- "flake8-bugbear==24.12.12"
54+
- "flake8-docstrings==1.7.0"
55+
- "flake8-mutable==1.2.0"
56+
- "flake8-pep3101==2.1.0"
57+
- "pep8-naming==0.14.1"
58+
- "pycodestyle==2.13.0"
59+
- "pydocstyle==6.3.0"
60+
- "pyflakes==3.3.2"
61+
pass_filenames: false
5762

5863
- repo: https://github.com/PyCQA/isort
59-
rev: "5.12.0"
64+
rev: "6.0.1"
6065
hooks:
6166
- id: isort
6267
args: ["--filter-files"]
6368

6469
- repo: https://github.com/pre-commit/pre-commit-hooks
65-
rev: "v4.4.0"
70+
rev: "v5.0.0"
6671
hooks:
6772
- id: check-ast
6873
- id: check-builtin-literals
@@ -104,6 +109,6 @@ repos:
104109
- id: text-unicode-replacement-char
105110

106111
- repo: https://github.com/mgedmin/check-manifest
107-
rev: "0.49"
112+
rev: "0.50"
108113
hooks:
109114
- id: check-manifest

CONTRIBUTING.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Klein is an open source project that welcomes contributions of all kinds coming
1313
Getting started
1414
===============
1515

16-
Here is a list of shell commands that will install the dependencies of Klein, run the test suite with Python 3.8 and the current version of Twisted, compile the documentation, and check for coding style issues with flake8.
16+
Here is a list of shell commands that will install the dependencies of Klein, run the test suite with Python 3.8 and Twisted 23.8, compile the documentation, and check for coding style issues with flake8.
1717

1818
.. code-block:: shell
1919
2020
pip install --user tox
21-
tox -e py38-twcurrent
21+
tox -e py312-tw238
2222
tox -e docs
2323
tox -e flake8
2424
@@ -45,7 +45,7 @@ Code
4545
Klein uses `Twisted Trial <https://docs.twisted.org/en/stable/api/twisted.trial.html>`_ and `tox <https://tox.readthedocs.io/en/latest/>`_ for its tests.
4646
The command to run the full test suite is ``tox`` with no arguments.
4747
This will run tests against several versions of Python and Twisted, which can be time-consuming.
48-
To run tests against only one or a few versions, pass a ``-e`` argument with an environment from the envlist in ``tox.ini``: for example, ``tox -e py38-twcurrent`` will run tests with Python 3.8 and the current released version of Twisted.
48+
To run tests against only one or a few versions, pass a ``-e`` argument with an environment from the envlist in ``tox.ini``: for example, ``tox -e py38-tw238`` will run tests with Python 3.8 and Twisted 23.8.
4949
To run only one or a few specific tests in the suite, add a filename or fully-qualified Python path to the end of the test invocation: for example, ``tox klein.test.test_app.KleinTestCase.test_foo`` will run only the ``test_foo()`` method of the ``KleinTestCase`` class in ``klein/test/test_app.py``.
5050
These two test shortcuts can be combined to give you a quick feedback cycle, but make sure to check on the full test suite from time to time to make sure changes haven't had unexpected side effects.
5151
- Show us your code changes through pull requests sent to `Klein's GitHub repo <https://github.com/twisted/klein>`_.
@@ -58,7 +58,7 @@ Code
5858
Documentation
5959
-------------
6060

61-
Klein uses `Epydoc <http://epydoc.sourceforge.net/manual-epytext.html>`_ for docstrings in code and uses `Sphinx <https://www.sphinx-doc.org/en/master/>`_ for standalone documentation.
61+
Klein uses `Epydoc <https://epydoc.sourceforge.net/manual-epytext.html>`_ for docstrings in code and uses `Sphinx <https://www.sphinx-doc.org/en/master/>`_ for standalone documentation.
6262

6363
- In documents with headers, use this format and order for headers::
6464

NEWS.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
NEWS
22
====
33

4-
NEXT
5-
----
4+
23.12.0 - 2023-12-22
5+
--------------------
66

77
* Fixed a compatibility issue with Werkzeug versions greater than 2.2. [`#575 <https://github.com/twisted/klein/pull/575>`]
88
* Added explicit support for Python 3.10 and 3.11, although in practice they did work previously in 21.8. [`#578 <https://github.com/twisted/klein/pull/578>`]

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@ def load_source(modname, filename):
7070
# API links extension, stolen from Twisted's Sphinx setup
7171
extensions.append("apilinks")
7272
apilinks_base_url = "https://docs.twisted.org/en/stable/api/"
73+
74+
user_agent = "Klein-Linkcheck/1.0.0"

docs/release.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,22 @@ Releasing Klein
1313

1414
#. Start with a clean (no changes) source tree on the trunk branch.
1515
#. Create a new release candidate: :code:`tox -e release -- start`
16+
#. Manually update the ``NEXT`` heading in ``NEWS.rst`` to reference the
17+
version that was just updated, *without* the "rc" release-candidate tag, and
18+
the current RFC3339-formatted date; i.e. write the ``NEWS.rst`` file as if
19+
it were for the final release.
1620
#. Commit and push the branch
1721
#. Open a PR from the branch (follow the usual process for opening a PR).
18-
#. As appropriate, pull the latest code from :code:`trunk`: :code:`git checkout trunk && git pull --rebase` (or use the GitHub UI)
19-
#. To publish a release candidate to PyPI: :code:`tox -e release -- publish`
22+
#. As appropriate, pull the latest code from :code:`trunk`: :code:`git checkout
23+
trunk && git pull --rebase` (or use the GitHub UI)
24+
#. To publish a release candidate to PyPI: :code:`tox -e release -- publish --candidate`
2025
#. Obtain an approving review for the PR using the usual process.
21-
#. To publish a production release: :code:`tox -e release -- publish --final`
26+
#. If the date has changed since the release candidate, update the RFC3339 date
27+
in the ``NEWS.rst`` header for the release to the current date; commit and
28+
push this change to the branch.
29+
#. Publish a production release with the command: :code:`tox -e release --
30+
publish --final`
31+
#. In ``NEWS.rst``, add a new "NEXT" section at the top. You do not need a
32+
separate review for this addition; it should be done after the release, but
33+
before merging to trunk.
2234
#. Merge the PR to the trunk branch.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ build-backend = "setuptools.build_meta"
77
[tool.black]
88

99
line-length = 80
10-
target-version = ["py36"]
10+
target-version = ["py39"]

0 commit comments

Comments
 (0)