style: fix formatter and linter errors

This commit is contained in:
Sigurd Spieckermann 2025-04-09 09:30:01 +02:00 committed by Sigurd Spieckermann
parent f374fd9baa
commit b42a032f7b
14 changed files with 29 additions and 26 deletions

View File

@ -49,10 +49,11 @@ copier --help-all
"""
import sys
from collections.abc import Iterable
from os import PathLike
from pathlib import Path
from textwrap import dedent
from typing import Any, Callable, Iterable, Optional
from typing import Any, Callable, Optional
import yaml
from plumbum import cli, colors

View File

@ -4,9 +4,10 @@ from __future__ import annotations
import subprocess
import sys
from collections.abc import Sequence
from pathlib import Path
from subprocess import CompletedProcess
from typing import TYPE_CHECKING, Sequence
from typing import TYPE_CHECKING
from .tools import printf_exception
from .types import PathSeq

View File

@ -2,7 +2,8 @@
from __future__ import annotations
from typing import Any, Callable, Iterable
from collections.abc import Iterable
from typing import Any, Callable
from jinja2 import nodes
from jinja2.exceptions import UndefinedError

View File

@ -6,6 +6,7 @@ import os
import platform
import subprocess
import sys
from collections.abc import Iterable, Mapping, Sequence
from contextlib import suppress
from contextvars import ContextVar
from dataclasses import field, replace
@ -19,10 +20,7 @@ from types import TracebackType
from typing import (
Any,
Callable,
Iterable,
Literal,
Mapping,
Sequence,
TypeVar,
get_args,
overload,

View File

@ -5,12 +5,13 @@ from __future__ import annotations
import re
import sys
from collections import ChainMap, defaultdict
from collections.abc import Mapping, Sequence
from contextlib import suppress
from dataclasses import field
from functools import cached_property
from pathlib import Path, PurePosixPath
from shutil import rmtree
from typing import Any, Literal, Mapping, Sequence
from typing import Any, Literal
from warnings import warn
import dunamai

View File

@ -8,13 +8,14 @@ import platform
import re
import stat
import sys
from collections.abc import Iterator
from contextlib import suppress
from decimal import Decimal
from enum import Enum
from importlib.metadata import version
from pathlib import Path
from types import TracebackType
from typing import Any, Callable, Iterator, Literal, TextIO, cast
from typing import Any, Callable, Literal, TextIO, cast
import colorama
from packaging.version import Version

View File

@ -3,6 +3,7 @@
from __future__ import annotations
import sys
from collections.abc import Iterator, Mapping, MutableMapping, Sequence
from contextlib import contextmanager
from contextvars import ContextVar
from enum import Enum
@ -11,14 +12,9 @@ from typing import (
Annotated,
Any,
Callable,
Dict,
Iterator,
Literal,
Mapping,
MutableMapping,
NewType,
Optional,
Sequence,
TypeVar,
Union,
)
@ -32,7 +28,7 @@ else:
# simple types
StrOrPath = Union[str, Path]
AnyByStrDict = Dict[str, Any]
AnyByStrDict = dict[str, Any]
AnyByStrMutableMapping = MutableMapping[str, Any]
# sequences

View File

@ -2,8 +2,9 @@ from __future__ import annotations
import platform
import sys
from collections.abc import Iterator
from pathlib import Path
from typing import Any, Iterator
from typing import Any
from unittest.mock import patch
import pytest

View File

@ -5,10 +5,11 @@ import json
import os
import sys
import textwrap
from collections.abc import Mapping
from enum import Enum
from hashlib import sha1
from pathlib import Path
from typing import Any, Mapping, Protocol
from typing import Any, Protocol
from pexpect.popen_spawn import PopenSpawn
from plumbum import local

View File

@ -4,13 +4,13 @@ import filecmp
import platform
import stat
import sys
from contextlib import nullcontext as does_not_raise
from contextlib import AbstractContextManager, nullcontext as does_not_raise
from decimal import Decimal
from enum import Enum
from pathlib import Path
from textwrap import dedent, indent
from time import sleep
from typing import Any, ContextManager
from typing import Any
import pytest
import yaml
@ -736,7 +736,7 @@ def test_validate_init_data(
tmp_path_factory: pytest.TempPathFactory,
spec: AnyByStrDict,
value: Any,
expected: ContextManager[None],
expected: AbstractContextManager[None],
) -> None:
src, dst = map(tmp_path_factory.mktemp, ("src", "dst"))
build_file_tree(
@ -924,7 +924,7 @@ def test_validate_default_value(
tmp_path_factory: pytest.TempPathFactory,
type_name: str,
default: Any,
expected: ContextManager[None],
expected: AbstractContextManager[None],
) -> None:
src, dst = map(tmp_path_factory.mktemp, ("src", "dst"))
build_file_tree(

View File

@ -1,6 +1,6 @@
import platform
from collections.abc import Mapping
from pathlib import Path
from typing import Mapping
import pytest

View File

@ -3,8 +3,9 @@ from __future__ import annotations
import platform
import subprocess
import sys
from collections.abc import Mapping
from pathlib import Path
from typing import Any, Dict, List, Mapping, Protocol, Union
from typing import Any, Protocol, Union
import pexpect
import pytest
@ -797,8 +798,8 @@ def test_required_choice_question(
QuestionType: TypeAlias = str
QuestionChoices: TypeAlias = Union[List[Any], Dict[str, Any]]
ParsedValues: TypeAlias = List[Any]
QuestionChoices: TypeAlias = Union[list[Any], dict[str, Any]]
ParsedValues: TypeAlias = list[Any]
_CHOICES: dict[str, tuple[QuestionType, QuestionChoices, ParsedValues]] = {
"str": ("str", ["one", "two", "three"], ["one", "two", "three"]),

View File

@ -1,8 +1,8 @@
from __future__ import annotations
import json
from collections.abc import Sequence
from datetime import datetime
from typing import Sequence
import pexpect
import pytest

View File

@ -1,7 +1,8 @@
import os
import shutil
from collections.abc import Iterator, Sequence
from pathlib import Path
from typing import Callable, Iterator, Sequence
from typing import Callable
import pytest
from packaging.version import Version