Skip to content

Commit bb2f8a7

Browse files
committed
style: fix ruff warned style
1 parent 7e23626 commit bb2f8a7

File tree

9 files changed

+14
-11
lines changed

9 files changed

+14
-11
lines changed

commitizen/changelog.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929

3030
import re
3131
from collections import OrderedDict, defaultdict
32+
from collections.abc import Iterable
3233
from dataclasses import dataclass
3334
from datetime import date
34-
from typing import TYPE_CHECKING, Iterable
35+
from typing import TYPE_CHECKING
3536

3637
from jinja2 import (
3738
BaseLoader,

commitizen/changelog_formats/restructuredtext.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import re
44
import sys
55
from itertools import zip_longest
6-
from typing import IO, TYPE_CHECKING, Any, Tuple, Union
6+
from typing import IO, TYPE_CHECKING, Any, Union
77

88
from commitizen.changelog import Metadata
99

@@ -18,7 +18,7 @@
1818

1919

2020
# Can't use `|` operator and native type because of https://bugs.python.org/issue42233 only fixed in 3.10
21-
TitleKind: TypeAlias = Union[str, Tuple[str, str]]
21+
TitleKind: TypeAlias = Union[str, tuple[str, str]]
2222

2323

2424
class RestructuredText(BaseFormat):

commitizen/cli.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import argparse
44
import logging
55
import sys
6+
from collections.abc import Sequence
67
from copy import deepcopy
78
from functools import partial
89
from pathlib import Path
910
from types import TracebackType
10-
from typing import Any, Sequence
11+
from typing import Any
1112

1213
import argcomplete
1314
from decli import cli

commitizen/cz/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pkgutil
55
import sys
66
import warnings
7-
from typing import Iterable
7+
from collections.abc import Iterable
88

99
if sys.version_info >= (3, 10):
1010
from importlib import metadata

commitizen/cz/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from __future__ import annotations
22

33
from abc import ABCMeta, abstractmethod
4-
from typing import Any, Callable, Iterable, Protocol
4+
from collections.abc import Iterable
5+
from typing import Any, Callable, Protocol
56

67
from jinja2 import BaseLoader, PackageLoader
78
from prompt_toolkit.styles import Style, merge_styles

commitizen/defaults.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import pathlib
44
from collections import OrderedDict
5-
from typing import Any, Iterable, MutableMapping, TypedDict
5+
from collections.abc import Iterable, MutableMapping
6+
from typing import Any, TypedDict
67

78
# Type
89
Questions = Iterable[MutableMapping[str, Any]]

commitizen/version_schemes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
ClassVar,
1111
Literal,
1212
Protocol,
13-
Type,
1413
cast,
1514
runtime_checkable,
1615
)
@@ -150,7 +149,7 @@ def bump(
150149

151150
# With PEP 440 and SemVer semantic, Scheme is the type, Version is an instance
152151
Version: TypeAlias = VersionProtocol
153-
VersionScheme: TypeAlias = Type[VersionProtocol]
152+
VersionScheme: TypeAlias = type[VersionProtocol]
154153

155154

156155
class BaseVersion(_BaseVersion):

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import os
44
import re
55
import tempfile
6+
from collections.abc import Iterator
67
from pathlib import Path
7-
from typing import Iterator
88

99
import pytest
1010
from pytest_mock import MockerFixture

tests/providers/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
import os
4+
from collections.abc import Iterator
45
from pathlib import Path
5-
from typing import Iterator
66

77
import pytest
88

0 commit comments

Comments
 (0)