|
10 | 10 | import os
|
11 | 11 | import pathlib
|
12 | 12 | import typing as t
|
13 |
| -from typing import Literal, Optional, Union |
14 | 13 |
|
15 | 14 | import kaptan
|
16 | 15 |
|
@@ -161,10 +160,10 @@ def find_home_config_files(
|
161 | 160 |
|
162 | 161 |
|
163 | 162 | 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", "*"]] |
168 | 167 | ] = ["json", "yaml"],
|
169 | 168 | include_home: bool = False,
|
170 | 169 | ):
|
@@ -325,9 +324,9 @@ def in_dir(config_dir=None, extensions: list[str] = [".yml", ".yaml", ".json"]):
|
325 | 324 |
|
326 | 325 | def filter_repos(
|
327 | 326 | 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, |
331 | 330 | ) -> list[ConfigDict]:
|
332 | 331 | """Return a :py:obj:`list` list of repos from (expanded) config file.
|
333 | 332 |
|
@@ -376,7 +375,7 @@ def filter_repos(
|
376 | 375 |
|
377 | 376 |
|
378 | 377 | 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"] |
380 | 379 | ):
|
381 | 380 | """Return True if file has a valid config file type.
|
382 | 381 |
|
|
0 commit comments