Skip to content

Commit 30fade1

Browse files
authored
Drop Python 3.9 and PyPy 3.10, bump tool versions (#250)
1 parent 0e2f11c commit 30fade1

File tree

16 files changed

+51
-64
lines changed

16 files changed

+51
-64
lines changed

.github/workflows/checks.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ jobs:
2121
- python-version: '3.13'
2222
env:
2323
TOXENV: docs
24-
- python-version: '3.13'
24+
- python-version: '3.14'
2525
env:
2626
TOXENV: pre-commit
27-
- python-version: '3.13'
27+
- python-version: '3.14'
2828
env:
2929
TOXENV: pylint
30-
- python-version: '3.13'
30+
- python-version: '3.14'
3131
env:
3232
TOXENV: typing
33-
- python-version: '3.13'
33+
- python-version: '3.14'
3434
env:
3535
TOXENV: twinecheck
3636

3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v5
3939

4040
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v5
41+
uses: actions/setup-python@v6
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515

16-
- name: Set up Python 3.13
17-
uses: actions/setup-python@v5
16+
- name: Set up Python 3.14
17+
uses: actions/setup-python@v6
1818
with:
19-
python-version: '3.13'
19+
python-version: '3.14'
2020

2121
- name: Check Tag
2222
id: check-release-tag

.github/workflows/tests-macos.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python-version:
20-
- '3.9'
2120
- '3.10'
2221
- '3.11'
2322
- '3.12'
2423
- '3.13'
25-
- 3.14.0-rc.1
26-
- pypy3.10
24+
- '3.14'
2725
- pypy3.11
2826

2927
steps:
30-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
3129

3230
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v5
31+
uses: actions/setup-python@v6
3432
with:
3533
python-version: ${{ matrix.python-version }}
3634

.github/workflows/tests-ubuntu.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python-version:
20-
- '3.9'
2120
- '3.10'
2221
- '3.11'
2322
- '3.12'
2423
- '3.13'
25-
- 3.14.0-rc.1
26-
- pypy3.10
24+
- '3.14'
2725
- pypy3.11
2826

2927
steps:
30-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
3129

3230
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v5
31+
uses: actions/setup-python@v6
3432
with:
3533
python-version: ${{ matrix.python-version }}
3634

.github/workflows/tests-windows.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python-version:
20-
- '3.9'
2120
- '3.10'
2221
- '3.11'
2322
- '3.12'
2423
- '3.13'
25-
- 3.14.0-rc.1
26-
- pypy3.10
24+
- '3.14'
2725
- pypy3.11
2826

2927
steps:
30-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
3129

3230
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v5
31+
uses: actions/setup-python@v6
3432
with:
3533
python-version: ${{ matrix.python-version }}
3634

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.12.5
4+
rev: v0.14.4
55
hooks:
66
- id: ruff-check
77
args: [--fix]
88
- id: ruff-format
99
- repo: https://github.com/adamchainz/blacken-docs
10-
rev: 1.19.1
10+
rev: 1.20.0
1111
hooks:
1212
- id: blacken-docs
1313
additional_dependencies:
14-
- black==25.1.0
14+
- black==25.9.0
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v5.0.0
16+
rev: v6.0.0
1717
hooks:
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This is a Python library of web-related functions, such as:
2727
Requirements
2828
============
2929

30-
Python 3.9+
30+
Python 3.10+
3131

3232
Install
3333
=======

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Modules
2828
Requirements
2929
============
3030

31-
Python 3.9+
31+
Python 3.10+
3232

3333
Install
3434
=======

pyproject.toml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ classifiers = [
1717
"Operating System :: OS Independent",
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
@@ -28,7 +27,7 @@ classifiers = [
2827
"Topic :: Internet :: WWW/HTTP",
2928
"Topic :: Software Development :: Libraries :: Python Modules",
3029
]
31-
requires-python = ">=3.9"
30+
requires-python = ">=3.10"
3231
dynamic = ["version"]
3332

3433
[project.urls]
@@ -66,18 +65,8 @@ filename = "docs/conf.py"
6665
[tool.coverage.run]
6766
branch = true
6867

69-
[tool.coverage.report]
70-
exclude_also = [
71-
"if TYPE_CHECKING:",
72-
]
73-
7468
[tool.mypy]
75-
check_untyped_defs = true
76-
77-
[[tool.mypy.overrides]]
78-
# All non-tests functions must be typed.
79-
module = "w3lib.*"
80-
allow_untyped_defs = false
69+
strict = true
8170

8271
[[tool.mypy.overrides]]
8372
# Allow test functions to be untyped

tests/test_encoding.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class TestHtmlConversion:
137137
def test_unicode_body(self):
138138
unicode_string = "\u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0435\u043a\u0441\u0442"
139139
original_string = unicode_string.encode("cp1251")
140-
encoding, body_unicode = html_to_unicode(ct("cp1251"), original_string)
140+
_, body_unicode = html_to_unicode(ct("cp1251"), original_string)
141141
# check body_as_unicode
142142
assert isinstance(body_unicode, str)
143143
assert body_unicode == unicode_string
@@ -207,15 +207,15 @@ def test_utf8_unexpected_end_of_data_with_valid_utf8_BOM(self):
207207

208208
def test_replace_wrong_encoding(self):
209209
"""Test invalid chars are replaced properly"""
210-
encoding, body_unicode = html_to_unicode(ct("utf-8"), b"PREFIX\xe3\xabSUFFIX")
210+
_, body_unicode = html_to_unicode(ct("utf-8"), b"PREFIX\xe3\xabSUFFIX")
211211
# XXX: Policy for replacing invalid chars may suffer minor variations
212212
# but it should always contain the unicode replacement char ('\ufffd')
213213
assert "\ufffd" in body_unicode, repr(body_unicode)
214214
assert "PREFIX" in body_unicode, repr(body_unicode)
215215
assert "SUFFIX" in body_unicode, repr(body_unicode)
216216

217217
# Do not destroy html tags due to encoding bugs
218-
encoding, body_unicode = html_to_unicode(ct("utf-8"), b"\xf0<span>value</span>")
218+
_, body_unicode = html_to_unicode(ct("utf-8"), b"\xf0<span>value</span>")
219219
assert "<span>value</span>" in body_unicode, repr(body_unicode)
220220

221221
def _assert_encoding_detected(

0 commit comments

Comments
 (0)