Skip to content

Commit ce4afe4

Browse files
trym-bByron
authored andcommitted
Revert "Replace wildcard imports with concrete imports"
This reverts commit 53d94b8. The reason for the revert is that the commit in question introduced a regression where certain modules, functions and classes that were exposed before were no longer exposed. See #1352 (comment) for additional information.
1 parent 53d94b8 commit ce4afe4

File tree

6 files changed

+30
-32
lines changed

6 files changed

+30
-32
lines changed

‎git/__init__.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
# flake8: noqa
77
#@PydevCodeAnalysisIgnore
8-
from git.exc import GitError, GitCommandError, GitCommandNotFound, UnmergedEntriesError, CheckoutError, InvalidGitRepositoryError, NoSuchPathError, BadName # @NoMove @IgnorePep8
8+
from git.exc import * # @NoMove @IgnorePep8
99
import inspect
1010
import os
1111
import sys
@@ -39,16 +39,16 @@ def _init_externals() -> None:
3939
#{ Imports
4040

4141
try:
42-
from git.config import GitConfigParser # @NoMove @IgnorePep8
43-
from git.objects import Blob, Commit, Object, Submodule, Tree # @NoMove @IgnorePep8
44-
from git.refs import Head, Reference, RefLog, RemoteReference, SymbolicReference, TagReference # @NoMove @IgnorePep8
45-
from git.diff import Diff, DiffIndex, NULL_TREE # @NoMove @IgnorePep8
46-
from git.db import GitCmdObjectDB, GitDB # @NoMove @IgnorePep8
47-
from git.cmd import Git # @NoMove @IgnorePep8
48-
from git.repo import Repo # @NoMove @IgnorePep8
49-
from git.remote import FetchInfo, PushInfo, Remote, RemoteProgress # @NoMove @IgnorePep8
50-
from git.index import BlobFilter, IndexEntry, IndexFile # @NoMove @IgnorePep8
51-
from git.util import ( # @NoMove @IgnorePep8
42+
from git.config import GitConfigParser # @NoMove @IgnorePep8
43+
from git.objects import * # @NoMove @IgnorePep8
44+
from git.refs import * # @NoMove @IgnorePep8
45+
from git.diff import * # @NoMove @IgnorePep8
46+
from git.db import * # @NoMove @IgnorePep8
47+
from git.cmd import Git # @NoMove @IgnorePep8
48+
from git.repo import Repo # @NoMove @IgnorePep8
49+
from git.remote import * # @NoMove @IgnorePep8
50+
from git.index import * # @NoMove @IgnorePep8
51+
from git.util import ( # @NoMove @IgnorePep8
5252
LockFile,
5353
BlockingLockFile,
5454
Stats,

‎git/exc.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
""" Module containing all exceptions thrown throughout the git package, """
77

8-
from gitdb.exc import BadName, BadObject # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
8+
from gitdb.exc import BadName # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
9+
from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
910
from git.compat import safe_decode
1011

1112
# typing ----------------------------------------------------

‎git/index/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Initialize the index package"""
22
# flake8: noqa
3-
from .base import IndexFile
4-
from .typ import IndexEntry, BlobFilter
3+
from .base import *
4+
from .typ import *

‎git/objects/__init__.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# flake8: noqa
55
import inspect
66

7-
from .base import Object, IndexObject
8-
from .blob import Blob
9-
from .commit import Commit
7+
from .base import *
8+
from .blob import *
9+
from .commit import *
1010
from .submodule import util as smutil
11-
from .submodule.base import Submodule, UpdateProgress
12-
from .submodule.root import RootModule, RootUpdateProgress
13-
from .tag import TagObject
14-
from .tree import Tree
11+
from .submodule.base import *
12+
from .submodule.root import *
13+
from .tag import *
14+
from .tree import *
1515
# Fix import dependency - add IndexObject to the util module, so that it can be
1616
# imported by the submodule.base
1717
smutil.IndexObject = IndexObject # type: ignore[attr-defined]

‎git/refs/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# flake8: noqa
22
# import all modules in order, fix the names they require
3-
from .symbolic import SymbolicReference
4-
from .reference import Reference
5-
from .head import HEAD, Head
6-
from .tag import TagReference
7-
from .remote import RemoteReference
3+
from .symbolic import *
4+
from .reference import *
5+
from .head import *
6+
from .tag import *
7+
from .remote import *
88

9-
from .log import RefLogEntry, RefLog
9+
from .log import *

‎test/lib/__init__.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
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+
# flake8: noqa
78
import inspect
8-
9-
from .helper import (GIT_DAEMON_PORT, SkipTest, StringProcessAdapter, TestBase,
10-
TestCase, fixture, fixture_path,
11-
with_rw_and_rw_remote_repo, with_rw_directory,
12-
with_rw_repo)
9+
from .helper import *
1310

1411
__all__ = [name for name, obj in locals().items()
1512
if not (name.startswith('_') or inspect.ismodule(obj))]

0 commit comments

Comments
 (0)