Skip to content

Commit 44a727e

Browse files
committed
modernize
1 parent d6d9a0f commit 44a727e

File tree

6 files changed

+48
-40
lines changed

6 files changed

+48
-40
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@ on:
88

99
jobs:
1010
tox:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
1212
strategy:
13-
max-parallel: 5
1413
matrix:
1514
python-version:
16-
- "3.9"
1715
- "3.10"
1816
- "3.11"
1917
- "3.12"
2018
- "3.13"
21-
- "pypy3.9"
19+
- "3.14"
20+
- "pypy3.11"
2221

2322
steps:
24-
- uses: actions/checkout@v2
25-
- uses: actions/setup-python@v5
23+
- uses: actions/checkout@v5
24+
- uses: actions/setup-python@v6
2625
with:
2726
python-version: ${{ matrix.python-version }}
2827
- name: Install tox

.readthedocs.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
# Read the Docs configuration file for Sphinx projects
12
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
24
version: 2
35

46
build:
5-
os: ubuntu-22.04
7+
os: ubuntu-24.04
68
tools:
7-
python: "3.13"
9+
python: "3.14"
10+
jobs:
11+
install:
12+
- pip install -U pip
13+
- pip install --group 'docs' .
814

915
sphinx:
1016
configuration: docs/source/conf.py

CHANGELOG.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Release History
88
- Fix "Upgrade" header value to match RFC.
99
- Add reason "Switching Protocols" to handshake response.
1010
- Add docs for `wsproto.Connection`
11-
- Add support for Python 3.12 and 3.13.
12-
- Drop support for Python 3.7 and 3.8.
11+
- Add support for Python 3.12, 3.13, and 3.14.
12+
- Drop support for Python 3.7, 3.8, and 3.9.
1313
- Various linting, styling, and packaging improvements.
1414

1515
1.2.0 (2022-08-23)

pyproject.toml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://packaging.python.org/en/latest/specifications/pyproject-toml/
33

44
[build-system]
5-
requires = ["setuptools"]
5+
requires = ["setuptools>=77"]
66
build-backend = "setuptools.build_meta"
77

88
[project]
@@ -18,7 +18,7 @@ maintainers = [
1818
{ name = "Thomas Kriechbaumer", email = "thomas@kriechbaumer.name" },
1919
]
2020

21-
requires-python = ">=3.9"
21+
requires-python = ">=3.10"
2222
dependencies = [
2323
"h11>=0.16.0,<1",
2424
]
@@ -31,11 +31,11 @@ classifiers = [
3131
"Programming Language :: Python",
3232
"Programming Language :: Python :: 3 :: Only",
3333
"Programming Language :: Python :: 3",
34-
"Programming Language :: Python :: 3.9",
3534
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
3736
"Programming Language :: Python :: 3.12",
3837
"Programming Language :: Python :: 3.13",
38+
"Programming Language :: Python :: 3.14",
3939
"Programming Language :: Python :: Implementation :: CPython",
4040
"Programming Language :: Python :: Implementation :: PyPy",
4141
]
@@ -62,21 +62,21 @@ testing = [
6262
]
6363

6464
linting = [
65-
"ruff>=0.8.0,<1",
66-
"mypy>=1.13.0,<2",
67-
"typing_extensions>=4.12.2",
65+
"ruff>=0.14.4,<1",
66+
"mypy>=1.18.2,<2",
67+
"typing_extensions>=4.15.0",
6868
]
6969

7070
packaging = [
71-
"check-manifest==0.50",
71+
"check-manifest==0.51",
7272
"readme-renderer==44.0",
73-
"build>=1.2.2,<2",
74-
"twine>=6.1.0,<7",
75-
"wheel>=0.45.0,<1",
73+
"build>=1.3.0,<2",
74+
"twine>=6.2.0,<7",
75+
"wheel>=0.45.1,<1",
7676
]
7777

7878
docs = [
79-
"sphinx>=7.4.7,<9",
79+
"sphinx>=8.2.3,<9",
8080
]
8181

8282
[tool.setuptools.packages.find]
@@ -107,6 +107,7 @@ lint.ignore = [
107107
"CPY", # not required
108108
"D101", # docs readability
109109
"D102", # docs readability
110+
"D103", # docs readability
110111
"D105", # docs readability
111112
"D107", # docs readability
112113
"D200", # docs readability
@@ -135,6 +136,7 @@ lint.ignore = [
135136
"ARG001", # readability
136137
"ARG002", # readability
137138
"PLR0913", # readability
139+
"FBT003", # readability
138140
]
139141
lint.isort.required-imports = [ "from __future__ import annotations" ]
140142

@@ -143,6 +145,13 @@ warn_unused_configs = true
143145
show_error_codes = true
144146
strict = true
145147

148+
[[tool.mypy.overrides]]
149+
module = [
150+
"h11",
151+
"h11._headers",
152+
]
153+
ignore_missing_imports = true
154+
146155
[tool.pytest.ini_options]
147156
testpaths = [ "tests" ]
148157

@@ -168,16 +177,16 @@ source = [
168177

169178
[tool.tox]
170179
min_version = "4.23.2"
171-
env_list = [ "py39", "py310", "py311", "py312", "py313", "pypy3", "lint", "docs", "packaging" ]
180+
env_list = [ "py310", "py311", "py312", "py313", "py314", "pypy311", "lint", "docs", "packaging" ]
172181

173182
[tool.tox.gh-actions]
174183
python = """
175-
3.9: py39, lint, docs, packaging
176-
3.10: py310
184+
3.10: py310, lint, docs, packaging
177185
3.11: py311
178186
3.12: py312
179187
3.13: py313
180-
pypy3: pypy3
188+
3.14: py314
189+
pypy3.11: pypy311
181190
"""
182191

183192
[tool.tox.env_run_base]
@@ -186,12 +195,6 @@ commands = [
186195
["python", "-bb", "-m", "pytest", "--cov-report=xml", "--cov-report=term", "--cov=wsproto", { replace = "posargs", extend = true }]
187196
]
188197

189-
[tool.tox.env.pypy3]
190-
# temporarily disable coverage testing on PyPy due to performance problems
191-
commands = [
192-
["pytest", { replace = "posargs", extend = true }]
193-
]
194-
195198
[tool.tox.env.lint]
196199
dependency_groups = ["linting"]
197200
commands = [
@@ -209,7 +212,7 @@ commands = [
209212
]
210213

211214
[tool.tox.env.packaging]
212-
base_python = ["python39"]
215+
base_python = ["python3.10"]
213216
dependency_groups = ["packaging"]
214217
allowlist_externals = ["rm"]
215218
commands = [
@@ -220,7 +223,7 @@ commands = [
220223
]
221224

222225
[tool.tox.env.publish]
223-
base_python = ["python39"]
226+
base_python = ["python3.10"]
224227
dependency_groups = ["packaging"]
225228
commands = [
226229
["python", "-m", "build", "--outdir", "dist/"],

src/wsproto/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77
from __future__ import annotations
88

9-
from typing import TYPE_CHECKING, Optional, Union
9+
from typing import TYPE_CHECKING
1010

1111
from .connection import Connection, ConnectionState, ConnectionType
1212
from .handshake import H11Handshake

src/wsproto/extensions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def enabled(self) -> bool:
122122

123123
def offer(self) -> bool | str:
124124
parameters = [
125-
"client_max_window_bits=%d" % self.client_max_window_bits,
126-
"server_max_window_bits=%d" % self.server_max_window_bits,
125+
f"client_max_window_bits={self.client_max_window_bits}",
126+
f"server_max_window_bits={self.server_max_window_bits}",
127127
]
128128

129129
if self.client_no_context_takeover:
@@ -181,10 +181,10 @@ def accept(self, offer: str) -> bool | None | str:
181181
parameters.append("server_no_context_takeover")
182182
try:
183183
if client_max_window_bits is not None:
184-
parameters.append("client_max_window_bits=%d" % client_max_window_bits)
184+
parameters.append(f"client_max_window_bits={client_max_window_bits}")
185185
self.client_max_window_bits = client_max_window_bits
186186
if server_max_window_bits is not None:
187-
parameters.append("server_max_window_bits=%d" % server_max_window_bits)
187+
parameters.append(f"server_max_window_bits={server_max_window_bits}")
188188
self.server_max_window_bits = server_max_window_bits
189189
except ValueError:
190190
return None
@@ -303,10 +303,10 @@ def frame_outbound(
303303
return (rsv, data)
304304

305305
def __repr__(self) -> str:
306-
descr = ["client_max_window_bits=%d" % self.client_max_window_bits]
306+
descr = [f"client_max_window_bits={self.client_max_window_bits}"]
307307
if self.client_no_context_takeover:
308308
descr.append("client_no_context_takeover")
309-
descr.append("server_max_window_bits=%d" % self.server_max_window_bits)
309+
descr.append(f"server_max_window_bits={self.server_max_window_bits}")
310310
if self.server_no_context_takeover:
311311
descr.append("server_no_context_takeover")
312312

0 commit comments

Comments
 (0)