Skip to content

Commit edc0f6d

Browse files
context_management: use ParamSpec from typing_extensions (#466)
context_management: use ParamSpec from typing_extensions Python < 3.10 does not have ParamSpec, so we need to import it from typing_extensions. Fixes #457 RELEASE NOTES BEGIN The context_management type stubs now use ParamSpec from typing_extensions to support Python < 3.10. RELEASE NOTES END Reviewed-by: Nikola Forró Reviewed-by: Maxwell G
2 parents fb72faf + 214f641 commit edc0f6d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ repos:
5050
- id: mypy
5151
args: [--show-error-codes, --ignore-missing-imports]
5252
additional_dependencies:
53-
[types-setuptools, types-requests, types-python-dateutil]
53+
- types-setuptools
54+
- types-requests
55+
- types-python-dateutil
56+
- typing_extensions
5457
# This file is overridden by a type stub
5558
exclude: "specfile/context_management.py"
5659
- repo: https://github.com/teemtee/tmt.git

specfile/context_management.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
import contextlib
55
from collections.abc import Iterator
6-
from typing import Callable, Generator, ParamSpec, TypeVar
6+
from typing import Callable, Generator, TypeVar
7+
8+
from typing_extensions import ParamSpec
79

810
_T_co = TypeVar("_T_co", covariant=True)
911
_P = ParamSpec("_P")

0 commit comments

Comments
 (0)