diff options
| author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-04-23 21:36:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-23 21:36:48 +0800 |
| commit | 4119a576251448793c07ebd080534948cad2f170 (patch) | |
| tree | 7bffff60a75770882832eec5ff2efcac9741139f /git/objects | |
| parent | 9f12c8c34371a7c46dad6788a48cf092042027ec (diff) | |
| parent | 043e15fe140cfff8725d4f615f42fa1c55779402 (diff) | |
| download | gitpython-4119a576251448793c07ebd080534948cad2f170.tar.gz | |
Merge pull request #1226 from muggenhor/testing
ci: check types with mypy
Diffstat (limited to 'git/objects')
| -rw-r--r-- | git/objects/__init__.py | 4 | ||||
| -rw-r--r-- | git/objects/base.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/git/objects/__init__.py b/git/objects/__init__.py index 23b2416a..897eb98f 100644 --- a/git/objects/__init__.py +++ b/git/objects/__init__.py @@ -16,8 +16,8 @@ from .tag import * from .tree import * # Fix import dependency - add IndexObject to the util module, so that it can be # imported by the submodule.base -smutil.IndexObject = IndexObject -smutil.Object = Object +smutil.IndexObject = IndexObject # type: ignore[attr-defined] +smutil.Object = Object # type: ignore[attr-defined] del(smutil) # must come after submodule was made available diff --git a/git/objects/base.py b/git/objects/base.py index cccb5ec6..59f0e836 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -7,6 +7,7 @@ from git.util import LazyMixin, join_path_native, stream_copy, bin_to_hex import gitdb.typ as dbtyp import os.path as osp +from typing import Optional # noqa: F401 unused import from .util import get_object_type_by_name @@ -24,7 +25,7 @@ class Object(LazyMixin): TYPES = (dbtyp.str_blob_type, dbtyp.str_tree_type, dbtyp.str_commit_type, dbtyp.str_tag_type) __slots__ = ("repo", "binsha", "size") - type = None # to be set by subclass + type = None # type: Optional[str] # to be set by subclass def __init__(self, repo, binsha): """Initialize an object by identifying it by its binary sha. |
