Skip to content

Commit 4778346

Browse files
authored
Drop Python 3.10 support (#310)
1 parent 5b3388f commit 4778346

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
19+
python-version: ["3.11", "3.12", "3.13", "3.14"]
2020

2121
name: Python ${{ matrix.python-version}}
2222
steps:

.github/workflows/test_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
python-version: ["3.10", "3.11", "3.12"]
12+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1313

1414
runs-on: ubuntu-latest
1515
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: "3.10"
2+
python: "3.11"
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: "v6.0.0"

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Changelog
22

3+
### Unreleased
4+
5+
- Dropped support for Python 3.10; minimum supported version is now Python 3.11
6+
37
### 5.0.3: (March 30th, 2026)
48

59
- Test Python 3.14 in CI (#302)

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
PROJECT_ROOT = Path(__file__).parent
88

99

10-
@nox.session(python=["3.10", "3.11", "3.12", "3.13", "3.14"])
10+
@nox.session(python=["3.11", "3.12", "3.13", "3.14"])
1111
def tests(session: Session) -> None:
1212
session.install(".[test]")
1313
venvroot = Path(session.bin).parent

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = {text = "MIT"}
1010
authors = [
1111
{name = "Hood Chatham", email = "roberthoodchatham@gmail.com"},
1212
]
13-
requires-python = ">=3.10"
13+
requires-python = ">=3.11"
1414
dependencies = [
1515
"attrs",
1616
"cattrs<25.1",
@@ -75,7 +75,7 @@ include = [
7575
packages = ["sphinx_js"]
7676

7777
[tool.mypy]
78-
python_version = "3.10"
78+
python_version = "3.11"
7979
show_error_codes = true
8080
warn_unreachable = true
8181
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
@@ -115,4 +115,4 @@ lint.select = [
115115
"PGH", # pygrep-hooks
116116
]
117117
lint.ignore = ["E402", "E501", "E731", "E741", "B904", "B020", "UP031"]
118-
target-version = "py310"
118+
target-version = "py311"

sphinx_js/suffix_tree.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from collections.abc import Iterable, Sequence
22
from typing import (
3-
Any,
43
Generic,
54
TypedDict,
65
TypeVar,
@@ -9,10 +8,9 @@
98
T = TypeVar("T")
109

1110

12-
# In Python 3.10: Cannot inherit from TypedDict and Generic.
13-
class _Tree(TypedDict, total=False):
14-
value: Any
15-
subtree: dict[str, "_Tree"]
11+
class _Tree(TypedDict, Generic[T], total=False):
12+
value: T
13+
subtree: dict[str, "_Tree[T]"]
1614

1715

1816
class SuffixTree(Generic[T]):
@@ -24,13 +22,13 @@ class SuffixTree(Generic[T]):
2422
def __init__(self) -> None:
2523
#: Internal structure is like... ::
2624
#:
27-
#: Tree = {value?: Any,
25+
#: Tree = {value?: T,
2826
#: subtree?: {segmentFoo: Tree, segmentBar: Tree, ...}}
2927
#
3028
#: A Tree can have a value key, a subtree key, or both. Subtree dicts
3129
#: always have at least 1 key. Every subtree has at least one value,
3230
#: directly or indirectly. ``self._tree`` itself is a Tree.
33-
self._tree: _Tree = {}
31+
self._tree: _Tree[T] = {}
3432

3533
def add(self, unambiguous_segments: Sequence[str], value: T) -> None:
3634
"""Add an item to the tree.
@@ -48,9 +46,7 @@ def add(self, unambiguous_segments: Sequence[str], value: T) -> None:
4846
else:
4947
tree["value"] = value
5048

51-
def add_many(
52-
self, segments_and_values: Iterable[tuple[Sequence[str], Any]]
53-
) -> None:
49+
def add_many(self, segments_and_values: Iterable[tuple[Sequence[str], T]]) -> None:
5450
"""Add a batch of items to the tree all at once, and collect any
5551
errors.
5652

0 commit comments

Comments
 (0)