summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiel van Schijndel <giel@mortis.eu>2021-04-23 12:24:07 +0200
committerGiel van Schijndel <giel@mortis.eu>2021-04-23 15:23:11 +0200
commit8470777b44bed4da87aad9474f88e7f0774252a6 (patch)
treedd7cd91e1a57bc7db8b0fb827e88a8401de0e346
parentc885781858ade2f660818e983915a6dae5672241 (diff)
downloadgitpython-8470777b44bed4da87aad9474f88e7f0774252a6.tar.gz
improvement: teach mypy how to deal with wildcard-imported objects
By telling it where it's imported from in one case and telling it to ignore it in another.
-rw-r--r--git/exc.py1
-rw-r--r--git/objects/__init__.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/git/exc.py b/git/exc.py
index 358e7ae4..6e646921 100644
--- a/git/exc.py
+++ b/git/exc.py
@@ -5,6 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
""" Module containing all exceptions thrown throughout the git package, """
+from gitdb.exc import BadName # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
from git.compat import safe_decode
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