Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfcc7418

Browse files
committed
Don't explicitly list direct submodules in __all__
This is for non-toplevel __all__, as git.__all__ already did notdo this.As noted in some of the previous commit messags that added them,omitting them might be a bit safer in terms of the impact of bugsbugs in code using GitPython, in that unexpected modules, some ofwhich have the same name as other modules within GitPython, won'tbe imported due to wildcard imports from intermediate subpackages(those that are below the top-level git package/module but collectnon-subpackage modules). Though it is hard to know, since some ofthese would have been imported before, when an __all__ was notdefined at that level.However, a separate benefit of omitting them is consistency withgit.__all__, which does not list the direct Python submodules ofthe git module.This does not affect the output of the modattrs.py script, becausethe attributes exist with the same objects as their values as aresult of those Python submodules being imported (in "from" importsand otherwise), including when importing the top-level git module.
1 parent00f4cbc commitfcc7418

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

‎git/index/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"""Initialize the index package."""
55

66
__all__= [
7-
"base",
8-
"fun",
9-
"typ",
10-
"util",
117
"BaseIndexEntry",
128
"BlobFilter",
139
"CheckoutError",
@@ -16,6 +12,5 @@
1612
"StageType",
1713
]
1814

19-
from .importbase,fun,typ,util
2015
from .baseimportCheckoutError,IndexFile
2116
from .typimportBaseIndexEntry,BlobFilter,IndexEntry,StageType

‎git/objects/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
"""Import all submodules' main classes into the package space."""
55

66
__all__= [
7-
"base",
8-
"blob",
9-
"commit",
10-
"submodule",
11-
"tag",
12-
"tree",
137
"IndexObject",
148
"Object",
159
"Blob",
@@ -23,7 +17,6 @@
2317
"TreeModifier",
2418
]
2519

26-
from .importbase,blob,commit,submodule,tag,tree
2720
from .baseimportIndexObject,Object
2821
from .blobimportBlob
2922
from .commitimportCommit

‎git/objects/submodule/__init__.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
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-
__all__= [
5-
"base",
6-
"root",
7-
"util",
8-
"Submodule",
9-
"UpdateProgress",
10-
"RootModule",
11-
"RootUpdateProgress",
12-
]
4+
__all__= ["Submodule","UpdateProgress","RootModule","RootUpdateProgress"]
135

14-
from .importbase,root,util
156
from .baseimportSubmodule,UpdateProgress
167
from .rootimportRootModule,RootUpdateProgress

‎git/refs/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
33

44
__all__= [
5-
"head",
6-
"log",
7-
"reference",
8-
"remote",
9-
"symbolic",
10-
"tag",
115
"HEAD",
126
"Head",
137
"RefLog",
@@ -19,7 +13,6 @@
1913
"TagReference",
2014
]
2115

22-
from .importhead,log,reference,remote,symbolic,tag
2316
from .headimportHEAD,Head
2417
from .logimportRefLog,RefLogEntry
2518
from .referenceimportReference

‎git/repo/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
"""Initialize the repo package."""
55

6-
__all__= ["base","fun","Repo"]
6+
__all__= ["Repo"]
77

8-
from .importbase,fun
98
from .baseimportRepo

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp