|
9 | 9 | import functools |
10 | 10 | import shlex |
11 | 11 | import textwrap |
12 | | -from collections.abc import Callable, Generator, Iterable, Iterator, Set |
| 12 | +from collections.abc import ( |
| 13 | + Callable, |
| 14 | + Generator, |
| 15 | + Iterable, |
| 16 | + Iterator, |
| 17 | + Mapping, |
| 18 | + Sequence, |
| 19 | + Set, |
| 20 | +) |
13 | 21 | from pathlib import Path |
14 | | -from typing import Any, Literal, Mapping, Sequence, TypedDict, Union # noqa: TID251 |
| 22 | +from typing import Any, Literal, TypedDict |
15 | 23 |
|
16 | 24 | from packaging.specifiers import SpecifierSet |
17 | 25 |
|
@@ -117,7 +125,7 @@ def architectures(self) -> set[Architecture]: |
117 | 125 | return self.globals.architectures |
118 | 126 |
|
119 | 127 |
|
120 | | -Setting = Union[Mapping[str, str], Sequence[str], str, int, bool] |
| 128 | +Setting = Mapping[str, str] | Sequence[str] | str | int | bool |
121 | 129 |
|
122 | 130 |
|
123 | 131 | @dataclasses.dataclass(frozen=True) |
@@ -258,7 +266,7 @@ def _stringify_setting( |
258 | 266 | raise ConfigOptionError(msg) |
259 | 267 | return list_sep.join(setting) |
260 | 268 |
|
261 | | - if isinstance(setting, (bool, int)): |
| 269 | + if isinstance(setting, bool | int): |
262 | 270 | return str(setting) |
263 | 271 |
|
264 | 272 | return setting |
@@ -838,7 +846,7 @@ def compute_options( |
838 | 846 | return options |
839 | 847 |
|
840 | 848 |
|
841 | | -@functools.lru_cache(maxsize=None) |
| 849 | +@functools.cache |
842 | 850 | def _get_pinned_container_images() -> Mapping[str, Mapping[str, str]]: |
843 | 851 | """ |
844 | 852 | This looks like a dict of dicts, e.g. |
|
0 commit comments