| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1c8310d commit 9f74c05
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,6 +60,7 @@ | |||
| 60 | 60 | PathLike, | |
| 61 | 61 | Lit_config_levels, | |
| 62 | 62 | Commit_ish, | |
| 63 | + CallableProgress, | ||
| 63 | 64 | Tree_ish, | |
| 64 | 65 | assert_never, | |
| 65 | 66 | ) | |
@@ -1258,7 +1259,7 @@ def _clone( | |||
| 1258 | 1259 | def clone( | |
| 1259 | 1260 | self, | |
| 1260 | 1261 | path: PathLike, | |
| 1261 | - progress: Optional[Callable] = None, | ||
| 1262 | + progress: Optional[CallableProgress] = None, | ||
| 1262 | 1263 | multi_options: Optional[List[str]] = None, | |
| 1263 | 1264 | allow_unsafe_protocols: bool = False, | |
| 1264 | 1265 | allow_unsafe_options: bool = False, | |
@@ -1297,7 +1298,7 @@ def clone_from( | |||
| 1297 | 1298 | cls, | |
| 1298 | 1299 | url: PathLike, | |
| 1299 | 1300 | to_path: PathLike, | |
| 1300 | - progress: Optional[Callable] = None, | ||
| 1301 | + progress: CallableProgress = None, | ||
| 1301 | 1302 | env: Optional[Mapping[str, str]] = None, | |
| 1302 | 1303 | multi_options: Optional[List[str]] = None, | |
| 1303 | 1304 | allow_unsafe_protocols: bool = False, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,42 +8,39 @@ | |||
| 8 | 8 | from typing import ( | |
| 9 | 9 | Dict, | |
| 10 | 10 | NoReturn, | |
| 11 | - Sequence, | ||
| 11 | + Sequence as Sequence, | ||
| 12 | 12 | Tuple, | |
| 13 | 13 | Union, | |
| 14 | 14 | Any, | |
| 15 | + Optional, | ||
| 16 | + Callable, | ||
| 15 | 17 | TYPE_CHECKING, | |
| 16 | 18 | TypeVar, | |
| 17 | 19 | ) # noqa: F401 | |
| 18 | 20 | ||
| 19 | - if sys.version_info[:2] >= (3, 8): | ||
| 21 | + if sys.version_info >= (3, 8): | ||
| 20 | 22 | from typing import ( | |
| 21 | 23 | Literal, | |
| 22 | - SupportsIndex, | ||
| 23 | 24 | TypedDict, | |
| 24 | 25 | Protocol, | |
| 26 | + SupportsIndex as SupportsIndex, | ||
| 25 | 27 | runtime_checkable, | |
| 26 | 28 | ) # noqa: F401 | |
| 27 | 29 | else: | |
| 28 | 30 | from typing_extensions import ( | |
| 29 | 31 | Literal, | |
| 30 | - SupportsIndex, # noqa: F401 | ||
| 32 | + SupportsIndex as SupportsIndex, | ||
| 31 | 33 | TypedDict, | |
| 32 | 34 | Protocol, | |
| 33 | 35 | runtime_checkable, | |
| 34 | 36 | ) # noqa: F401 | |
| 35 | 37 | ||
| 36 | - # if sys.version_info[:2] >= (3, 10): | ||
| 38 | + # if sys.version_info >= (3, 10): | ||
| 37 | 39 | # from typing import TypeGuard # noqa: F401 | |
| 38 | 40 | # else: | |
| 39 | 41 | # from typing_extensions import TypeGuard # noqa: F401 | |
| 40 | 42 | ||
| 41 | - | ||
| 42 | - if sys.version_info[:2] < (3, 9): | ||
| 43 | - PathLike = Union[str, os.PathLike] | ||
| 44 | - else: | ||
| 45 | - # os.PathLike only becomes subscriptable from Python 3.9 onwards | ||
| 46 | - PathLike = Union[str, os.PathLike[str]] | ||
| 43 | + PathLike = Union[str, "os.PathLike[str]"] | ||
| 47 | 44 | ||
| 48 | 45 | if TYPE_CHECKING: | |
| 49 | 46 | from git.repo import Repo | |
@@ -62,6 +59,9 @@ | |||
| 62 | 59 | ||
| 63 | 60 | Lit_config_levels = Literal["system", "global", "user", "repository"] | |
| 64 | 61 | ||
| 62 | + # Progress parameter type alias ----------------------------------------- | ||
| 63 | + | ||
| 64 | + CallableProgress = Optional[Callable[[int, Union[str, float], Union[str, float, None], str], None]] | ||
| 65 | 65 | ||
| 66 | 66 | # def is_config_level(inp: str) -> TypeGuard[Lit_config_levels]: | |
| 67 | 67 | # # return inp in get_args(Lit_config_level) # only py >= 3.8 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,4 +10,4 @@ pytest-icdiff | |||
| 10 | 10 | # pytest-profiling | |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | - tox | ||
| 13 | + tox | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments