88import os
99import pathlib
1010import typing as t
11+ from collections .abc import Callable
1112
1213from libvcs .sync .git import GitRemote
1314
1415from vcspull .validator import is_valid_config
1516
1617from . import exc
1718from ._internal .config_reader import ConfigReader , DuplicateAwareConfigReader
19+ from .types import ConfigDict , RawConfigDict
1820from .util import get_config_dir , update_dict
1921
2022log = logging .getLogger (__name__ )
2123
22- if t .TYPE_CHECKING :
23- from collections .abc import Callable
24- from typing import TypeGuard
25-
26- from .types import ConfigDict , RawConfigDict
27-
2824
2925def expand_dir (
3026 dir_ : pathlib .Path ,
@@ -34,14 +30,15 @@ def expand_dir(
3430
3531 Parameters
3632 ----------
37- _dir : pathlib.Path
33+ dir_ : pathlib.Path
34+ Directory path to expand
3835 cwd : pathlib.Path, optional
39- current working dir (for deciphering relative _dir paths), defaults to
40- :py:meth:`os.getcwd()`
36+ Current working dir (used to resolve relative paths). Defaults to
37+ :py:meth:`pathlib.Path.cwd`.
4138
4239 Returns
4340 -------
44- pathlib.Path :
41+ pathlib.Path
4542 Absolute directory path
4643 """
4744 dir_ = pathlib .Path (os .path .expandvars (str (dir_ ))).expanduser ()
@@ -136,7 +133,7 @@ def extract_repos(
136133 ** url ,
137134 )
138135
139- def is_valid_config_dict (val : t .Any ) -> TypeGuard [ConfigDict ]:
136+ def is_valid_config_dict (val : t .Any ) -> t . TypeGuard [ConfigDict ]:
140137 assert isinstance (val , dict )
141138 return True
142139
0 commit comments