Skip to content

Commit b607774

Browse files
committed
chore(ruff) Autofixes for ruff with Python 3.10+
Fixed 10 errors: - src/vcspull/_internal/config_reader.py: 1 × UP035 (deprecated-import) - src/vcspull/config.py: 1 × I001 (unsorted-imports) 1 × UP035 (deprecated-import) - src/vcspull/types.py: 1 × I001 (unsorted-imports) 1 × UP035 (deprecated-import) - src/vcspull/validator.py: 1 × UP035 (deprecated-import) - tests/test_cli.py: 1 × UP007 (non-pep604-annotation-union) 1 × UP035 (deprecated-import) 1 × I001 (unsorted-imports) 1 × UP045 (non-pep604-annotation-optional) Found 10 errors (10 fixed, 0 remaining). Changes: - Moved TypeAlias imports from typing_extensions to typing for Python 3.10+ compatibility - Updated imports to use typing.TypeGuard and typing.Literal instead of typing_extensions - Converted Union/Optional patterns to PEP 604 union syntax - Fixed import sorting and deprecated import patterns
1 parent 348a417 commit b607774

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ requires = ["hatchling"]
144144
build-backend = "hatchling.build"
145145

146146
[tool.mypy]
147-
python_version = 3.10
147+
python_version = "3.10"
148148
warn_unused_configs = true
149149
files = [
150150
"src",

src/vcspull/_internal/config_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import yaml
88

99
if t.TYPE_CHECKING:
10-
from typing_extensions import Literal, TypeAlias
10+
from typing import Literal, TypeAlias
1111

1212
FormatLiteral = Literal["json", "yaml"]
1313

src/vcspull/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
if t.TYPE_CHECKING:
2323
from collections.abc import Callable
24-
25-
from typing_extensions import TypeGuard
24+
from typing import TypeGuard
2625

2726
from .types import ConfigDict, RawConfigDict
2827

src/vcspull/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131

3232
import pathlib
3333
import typing as t
34+
from typing import TypeAlias
3435

35-
from typing_extensions import NotRequired, TypeAlias, TypedDict
36+
from typing_extensions import NotRequired, TypedDict
3637

3738
if t.TYPE_CHECKING:
3839
from libvcs._internal.types import StrPath, VCSLiteral

src/vcspull/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import typing as t
77

88
if t.TYPE_CHECKING:
9-
from typing_extensions import TypeGuard
9+
from typing import TypeGuard
1010

1111
from vcspull.types import RawConfigDict
1212

tests/test_cli.py

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

2323
if t.TYPE_CHECKING:
2424
import pathlib
25+
from typing import TypeAlias
2526

2627
from libvcs.sync.git import GitSync
27-
from typing_extensions import TypeAlias
2828

29-
ExpectedOutput: TypeAlias = t.Optional[t.Union[str, list[str]]]
29+
ExpectedOutput: TypeAlias = str | list[str] | None
3030

3131

3232
class SyncCLINonExistentRepo(t.NamedTuple):

0 commit comments

Comments
 (0)