Skip to content

Commit 8d2946c

Browse files
committed
refactor(config): Fix import typing
1 parent f727b48 commit 8d2946c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/vcspull/config.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import os
1111
import pathlib
1212
import typing as t
13-
from typing import Literal, Optional, Union
1413

1514
import kaptan
1615

@@ -161,10 +160,10 @@ def find_home_config_files(
161160

162161

163162
def find_config_files(
164-
path: Optional[Union[list[pathlib.Path], pathlib.Path]] = None,
165-
match: Union[list[str], str] = ["*"],
166-
filetype: Union[
167-
Literal["json", "yaml", "*"], list[Literal["json", "yaml", "*"]]
163+
path: t.Optional[t.Union[list[pathlib.Path], pathlib.Path]] = None,
164+
match: t.Union[list[str], str] = ["*"],
165+
filetype: t.Union[
166+
t.Literal["json", "yaml", "*"], list[t.Literal["json", "yaml", "*"]]
168167
] = ["json", "yaml"],
169168
include_home: bool = False,
170169
):
@@ -325,9 +324,9 @@ def in_dir(config_dir=None, extensions: list[str] = [".yml", ".yaml", ".json"]):
325324

326325
def filter_repos(
327326
config: list[ConfigDict],
328-
dir: Union[pathlib.Path, Literal["*"], None] = None,
329-
vcs_url: Union[str, None] = None,
330-
name: Union[str, None] = None,
327+
dir: t.Union[pathlib.Path, t.Literal["*"], None] = None,
328+
vcs_url: t.Union[str, None] = None,
329+
name: t.Union[str, None] = None,
331330
) -> list[ConfigDict]:
332331
"""Return a :py:obj:`list` list of repos from (expanded) config file.
333332
@@ -376,7 +375,7 @@ def filter_repos(
376375

377376

378377
def is_config_file(
379-
filename: str, extensions: Union[list[str], str] = [".yml", ".yaml", ".json"]
378+
filename: str, extensions: t.Union[list[str], str] = [".yml", ".yaml", ".json"]
380379
):
381380
"""Return True if file has a valid config file type.
382381

0 commit comments

Comments
 (0)