Skip to content

Commit 206f345

Browse files
committed
flake8 and forward ref fixes
1 parent 046899e commit 206f345

File tree

5 files changed

+8
-115
lines changed

5 files changed

+8
-115
lines changed

git/compat/compat.py

Lines changed: 0 additions & 107 deletions
This file was deleted.

git/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848

4949
# invariants
5050
# represents the configuration level of a configuration file
51-
CONFIG_LEVELS = ("system", "user", "global", "repository") # type: Tuple[Literal['system'], Literal['user'], Literal['global'], Literal['repository']]
51+
CONFIG_LEVELS = ("system", "user", "global", "repository"
52+
) # type: Tuple[Literal['system'], Literal['user'], Literal['global'], Literal['repository']]
5253

5354
# Section pattern to detect conditional includes.
5455
# https://git-scm.com/docs/git-config#_conditional_includes

git/remote.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# typing-------------------------------------------------------
3838

39-
from typing import Any, Callable, Dict, Iterator, List, Optional, TYPE_CHECKING, Union, cast, overload
39+
from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, TYPE_CHECKING, Union, cast, overload
4040

4141
from git.types import PathLike, Literal, TBD
4242

@@ -277,7 +277,7 @@ def refresh(cls) -> Literal[True]:
277277
return True
278278

279279
def __init__(self, ref: SymbolicReference, flags: int, note: str = '',
280-
old_commit: Union[Commit, TagReference, Tree, Blob, None] = None,
280+
old_commit: Union['Commit', TagReference, 'Tree', 'Blob', None] = None,
281281
remote_ref_path: Optional[PathLike] = None) -> None:
282282
"""
283283
Initialize a new instance
@@ -816,12 +816,11 @@ def fetch(self, refspec: Union[str, List[str], None] = None,
816816
if refspec is None:
817817
# No argument refspec, then ensure the repo's config has a fetch refspec.
818818
self._assert_refspec()
819-
assert refspec is not None # for typing
819+
820820
kwargs = add_progress(kwargs, self.repo.git, progress)
821821
if isinstance(refspec, list):
822-
args = refspec
822+
args = refspec # type: Sequence[Optional[str]] # should need this - check logic for passing None through
823823
else:
824-
825824
args = [refspec]
826825

827826
proc = self.repo.git.fetch(self, *args, as_process=True, with_stdout=False,

git/repo/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7-
from _typeshed import StrPath
87
import logging
98
import os
109
import re

git/util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,8 @@ def list_items(cls, repo: 'Repo', *args: Any, **kwargs: Any) -> 'IterableList':
996996
return out_list
997997

998998
@classmethod
999-
def iter_items(cls, repo: 'Repo', *args: Any, **kwargs: Any) -> Iterator[TBD]: # type to be compatible with subtypes e.g. Remote
999+
def iter_items(cls, repo: 'Repo', *args: Any, **kwargs: Any) -> Iterator[TBD]:
1000+
# return typed to be compatible with subtypes e.g. Remote
10001001
"""For more information about the arguments, see list_items
10011002
:return: iterator yielding Items"""
10021003
raise NotImplementedError("To be implemented by Subclass")

0 commit comments

Comments
 (0)