Skip to content

Commit de540b7

Browse files
committed
Add __all__ and imports in git.objects.submodule
This is the top-level of the git.objects.submodule subpackage, for its own Python submodules. This appears only not to have been done before because of a cyclic import problem involving imports that are no longer present. Doing it improves consistency, since all the other subpackages under the top-level git package already do this. The modattrs.py script reveals the four new attributes of git.objects.submodule for the four classes obtained by the new imports, as expected. (The explicit module imports do not change the attribues because they are the same attributes as come into existence due to those Python submodules being imported anywhere in any style.)
1 parent 3786307 commit de540b7

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Diff for: git/objects/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from .base import IndexObject, Object
2727
from .blob import Blob
2828
from .commit import Commit
29-
from .submodule.base import Submodule, UpdateProgress
30-
from .submodule.root import RootModule, RootUpdateProgress
29+
from .submodule import RootModule, RootUpdateProgress, Submodule, UpdateProgress
3130
from .tag import TagObject
3231
from .tree import Tree, TreeModifier

Diff for: git/objects/submodule/__init__.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# This module is part of GitPython and is released under the
22
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
33

4-
# NOTE: Cannot import anything here as the top-level __init__ has to handle
5-
# our dependencies.
4+
__all__ = [
5+
"base",
6+
"root",
7+
"util",
8+
"Submodule",
9+
"UpdateProgress",
10+
"RootModule",
11+
"RootUpdateProgress",
12+
]
13+
14+
from . import base, root, util
15+
from .base import Submodule, UpdateProgress
16+
from .root import RootModule, RootUpdateProgress

0 commit comments

Comments
 (0)