Skip to content

Commit 3648741

Browse files
committed
Drop Python 3.10 support.
1 parent c17ce31 commit 3648741

14 files changed

Lines changed: 20 additions & 66 deletions

File tree

‎.github/workflows/test-package.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
platform: [ubuntu-latest, macos-latest, windows-latest]
20-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
20+
python-version: ['3.11', '3.12', '3.13', '3.14', '3.15']
2121

2222
runs-on: ${{ matrix.platform }}
2323

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
rev: v3.22.0
77
hooks:
88
- id: pyupgrade
9-
args: ["--py310-plus"]
9+
args: ["--py311-plus"]
1010

1111
- repo: https://github.com/frostming/fix-future-annotations
1212
rev: 0.5.0

‎benedict/dicts/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
)
1111
from typing import (
1212
Any,
13+
Self,
1314
cast,
1415
)
1516

16-
from typing_extensions import Self, TypeVar
17+
from typing_extensions import TypeVar
1718

1819
from benedict.core import clean as _clean
1920
from benedict.core import clone as _clone

‎benedict/dicts/base/base_dict.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
Reversible,
1010
ValuesView,
1111
)
12-
from typing import Any
12+
from typing import Any, Self
1313

14-
from typing_extensions import Self, TypeVar
14+
from typing_extensions import TypeVar
1515

1616
from benedict.core.clone import clone as _clone
1717

‎benedict/dicts/io/io_dict.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import traceback
44
from pathlib import Path
5-
from typing import Any, NoReturn, cast
5+
from typing import Any, NoReturn, Self, cast
66

7-
from typing_extensions import Self, TypeVar
7+
from typing_extensions import TypeVar
88

99
from benedict.dicts.base import BaseDict
1010
from benedict.dicts.io import io_util

‎benedict/dicts/keypath/keypath_dict.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

33
from collections.abc import Iterable, Mapping
4-
from typing import Any
4+
from typing import Any, Self
55

6-
from typing_extensions import Self, TypeVar
6+
from typing_extensions import TypeVar
77

88
from benedict.dicts import KeylistDict
99
from benedict.dicts.keypath import keypath_util

‎benedict/dicts/parse/parse_util.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818

1919
from collections.abc import Callable
20-
from typing import Any, cast
20+
from typing import Any, cast, overload
2121

2222
from slugify import slugify
23-
from typing_extensions import TypeIs, overload
23+
from typing_extensions import TypeIs
2424

2525
from benedict.extras import require_parse
2626
from benedict.serializers import JSONSerializer

‎benedict/serializers/__init__.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from __future__ import annotations
22

33
import re
4-
from typing import Any, Literal, TypedDict, cast
5-
6-
from typing_extensions import overload
4+
from typing import Any, Literal, TypedDict, cast, overload
75

86
from benedict.serializers.abstract import AbstractSerializer
97
from benedict.serializers.base64 import Base64Serializer

‎benedict/serializers/toml.py‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
try:
2-
# python >= 3.11
3-
import tomllib
4-
5-
tomllib_available = True
6-
except ImportError:
7-
tomllib_available = False
8-
9-
try:
10-
import tomli
11-
12-
tomli_installed = True
13-
except ModuleNotFoundError: # pragma: no cover
14-
tomli_installed = False
1+
import tomllib
152

163
try:
174
import tomli_w
@@ -39,11 +26,7 @@ def __init__(self) -> None:
3926
)
4027

4128
def decode(self, s: str, **kwargs: Any) -> Any:
42-
if tomllib_available:
43-
data = tomllib.loads(s, **kwargs)
44-
else:
45-
require_toml(installed=tomli_installed)
46-
data = tomli.loads(s, **kwargs)
29+
data = tomllib.loads(s, **kwargs)
4730
return data
4831

4932
def encode(self, d: Any, **kwargs: Any) -> str:

‎pyproject.toml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ classifiers = [
7777
"Natural Language :: English",
7878
"Operating System :: OS Independent",
7979
"Programming Language :: Python :: 3",
80-
"Programming Language :: Python :: 3.10",
8180
"Programming Language :: Python :: 3.11",
8281
"Programming Language :: Python :: 3.12",
8382
"Programming Language :: Python :: 3.13",
@@ -95,7 +94,7 @@ dependencies = [
9594
"typing_extensions >= 4.13.2, < 4.17.0",
9695
]
9796
dynamic = ["version"]
98-
requires-python = ">=3.10"
97+
requires-python = ">=3.11"
9998
maintainers = [
10099
{ name = "Fabio Caccamo", email = "fabio.caccamo@gmail.com" },
101100
]
@@ -143,7 +142,6 @@ schema = [
143142
"pydantic >= 2.0.0, < 3.0.0",
144143
]
145144
toml = [
146-
"tomli >= 2.0.0, < 3.0.0; python_version < '3.11'",
147145
"tomli-w >= 1.0.0, < 2.0.0",
148146
]
149147
xls = [
@@ -181,14 +179,14 @@ cache_dir = ".mypy_cache"
181179
check_untyped_defs = true
182180
# disable import-related error codes:
183181
# - import-untyped: third-party libraries like xlrd, MailChecker lack type stubs
184-
# - import-not-found: tomllib is Python 3.11+ but we support 3.10+
182+
# - import-not-found: optional dependencies are not installed in the mypy environment
185183
disable_error_code = "import-untyped,import-not-found"
186184
disallow_any_generics = true
187185
disallow_subclassing_any = true
188186
explicit_package_bases = true
189187
incremental = true
190188
platform = "linux"
191-
python_version = "3.10"
189+
python_version = "3.11"
192190
show_column_numbers = true
193191
show_error_codes = true
194192
strict = true

0 commit comments

Comments
 (0)