From 39d37d550963a6a64e66ba3d6b9f4b077270a3ad Mon Sep 17 00:00:00 2001 From: Yobmod Date: Sat, 31 Jul 2021 22:26:20 +0100 Subject: replace some TBDs wiht runtime types --- git/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git/util.py') diff --git a/git/util.py b/git/util.py index 92d95379..8056804a 100644 --- a/git/util.py +++ b/git/util.py @@ -38,6 +38,7 @@ if TYPE_CHECKING: from git.remote import Remote from git.repo.base import Repo from git.config import GitConfigParser, SectionConstraint + from git import Git # from git.objects.base import IndexObject @@ -379,7 +380,7 @@ def get_user_id() -> str: return "%s@%s" % (getpass.getuser(), platform.node()) -def finalize_process(proc: subprocess.Popen, **kwargs: Any) -> None: +def finalize_process(proc: Union[subprocess.Popen, 'Git.AutoInterrupt'], **kwargs: Any) -> None: """Wait for the process (clone, fetch, pull or push) and handle its errors accordingly""" # TODO: No close proc-streams?? proc.wait(**kwargs) @@ -1033,7 +1034,7 @@ class IterableList(List[T_IterableObj]): class IterableClassWatcher(type): """ Metaclass that watches """ - def __init__(cls, name: str, bases: List, clsdict: Dict) -> None: + def __init__(cls, name: str, bases: Tuple, clsdict: Dict) -> None: for base in bases: if type(base) == IterableClassWatcher: warnings.warn(f"GitPython Iterable subclassed by {name}. " -- cgit v1.2.1 From 2163322ef62fa97573ac94298261161fd9721993 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 2 Aug 2021 14:00:33 +0100 Subject: increase mypy strictness (warn unused ignored) --- git/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/util.py') diff --git a/git/util.py b/git/util.py index 8056804a..63060530 100644 --- a/git/util.py +++ b/git/util.py @@ -403,8 +403,8 @@ def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[ try: p = osp.expanduser(p) # type: ignore if expand_vars: - p = osp.expandvars(p) # type: ignore - return osp.normpath(osp.abspath(p)) # type: ignore + p = osp.expandvars(p) + return osp.normpath(osp.abspath(p)) except Exception: return None -- cgit v1.2.1 From bef218246c9935f0c31b23a17d1a02ac3810301d Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 2 Aug 2021 15:41:17 +0100 Subject: rmv 3.6 from setup.py --- git/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/util.py') diff --git a/git/util.py b/git/util.py index 63060530..c20be6eb 100644 --- a/git/util.py +++ b/git/util.py @@ -403,8 +403,8 @@ def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[ try: p = osp.expanduser(p) # type: ignore if expand_vars: - p = osp.expandvars(p) - return osp.normpath(osp.abspath(p)) + p = osp.expandvars(p) # type: ignore + return osp.normpath(osp.abspath(p)) # type: ignore except Exception: return None -- cgit v1.2.1 From 481f672baab666d6e2f81e9288a5f3c42c884a8e Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 2 Aug 2021 17:56:06 +0100 Subject: Add __future__.annotations to repo/base.py --- git/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/util.py') diff --git a/git/util.py b/git/util.py index c20be6eb..4f82219e 100644 --- a/git/util.py +++ b/git/util.py @@ -70,7 +70,7 @@ from gitdb.util import ( # NOQA @IgnorePep8 # Most of these are unused here, but are for use by git-python modules so these # don't see gitdb all the time. Flake of course doesn't like it. __all__ = ["stream_copy", "join_path", "to_native_path_linux", - "join_path_native", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList", + "join_path_native", "Stats", "IndexFileSHA1Writer", "IterableObj", "IterableList", "BlockingLockFile", "LockFile", 'Actor', 'get_user_id', 'assure_directory_exists', 'RemoteProgress', 'CallableRemoteProgress', 'rmtree', 'unbare_repo', 'HIDE_WINDOWS_KNOWN_ERRORS'] -- cgit v1.2.1