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

Commite49327d

Browse files
committed
Add refresh to top-level __all__
This makes the git.refresh function unambiguously public.git.refresh was already public in the sense that it was explicitlydocumented as appropriate to call from code outside GitPython.However, it had not been included in git.__all__.Because __all__ existed but omitted "refresh", git.refresh hadappeared non-public to automated tools.This also does some cleanup:- It removes a comment that showed how git.__all__ had been defined dynamically before#1659, since with the addition of "refresh", git.__all__ no longer contains exactly the same elements as that technique produced (as it examined the module's contents prior to running the def statement that bound the name "refresh").- With that comment removed, it is no longer necessary to define __all__ below the imports to show what the dynamic techinque had operated on. So this moves it up above them in accordance with PEP-8.
1 parentb8a25df commite49327d

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

‎git/__init__.py

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,6 @@
55

66
# @PydevCodeAnalysisIgnore
77

8-
__version__="git"
9-
10-
fromtypingimportList,Optional,Sequence,Tuple,Union,TYPE_CHECKING
11-
12-
fromgitdb.utilimportto_hex_sha
13-
fromgit.excimport*# noqa: F403 # @NoMove @IgnorePep8
14-
fromgit.typesimportPathLike
15-
16-
try:
17-
fromgit.compatimportsafe_decode# @NoMove @IgnorePep8
18-
fromgit.configimportGitConfigParser# @NoMove @IgnorePep8
19-
fromgit.objectsimport*# noqa: F403 # @NoMove @IgnorePep8
20-
fromgit.refsimport*# noqa: F403 # @NoMove @IgnorePep8
21-
fromgit.diffimport*# noqa: F403 # @NoMove @IgnorePep8
22-
fromgit.dbimport*# noqa: F403 # @NoMove @IgnorePep8
23-
fromgit.cmdimportGit# @NoMove @IgnorePep8
24-
fromgit.repoimportRepo# @NoMove @IgnorePep8
25-
fromgit.remoteimport*# noqa: F403 # @NoMove @IgnorePep8
26-
fromgit.indeximport*# noqa: F403 # @NoMove @IgnorePep8
27-
fromgit.utilimport (# @NoMove @IgnorePep8
28-
LockFile,
29-
BlockingLockFile,
30-
Stats,
31-
Actor,
32-
remove_password_if_present,
33-
rmtree,
34-
)
35-
exceptGitErroras_exc:# noqa: F405
36-
raiseImportError("%s: %s"% (_exc.__class__.__name__,_exc))from_exc
37-
38-
# __all__ must be statically defined by py.typed support
39-
# __all__ = [name for name, obj in locals().items() if not (name.startswith("_") or inspect.ismodule(obj))]
408
__all__= [# noqa: F405
419
"Actor",
4210
"AmbiguousObjectName",
@@ -109,12 +77,43 @@
10977
"UnsupportedOperation",
11078
"UpdateProgress",
11179
"WorkTreeRepositoryUnsupported",
80+
"refresh",
11281
"remove_password_if_present",
11382
"rmtree",
11483
"safe_decode",
11584
"to_hex_sha",
11685
]
11786

87+
__version__="git"
88+
89+
fromtypingimportList,Optional,Sequence,Tuple,Union,TYPE_CHECKING
90+
91+
fromgitdb.utilimportto_hex_sha
92+
fromgit.excimport*# noqa: F403 # @NoMove @IgnorePep8
93+
fromgit.typesimportPathLike
94+
95+
try:
96+
fromgit.compatimportsafe_decode# @NoMove @IgnorePep8
97+
fromgit.configimportGitConfigParser# @NoMove @IgnorePep8
98+
fromgit.objectsimport*# noqa: F403 # @NoMove @IgnorePep8
99+
fromgit.refsimport*# noqa: F403 # @NoMove @IgnorePep8
100+
fromgit.diffimport*# noqa: F403 # @NoMove @IgnorePep8
101+
fromgit.dbimport*# noqa: F403 # @NoMove @IgnorePep8
102+
fromgit.cmdimportGit# @NoMove @IgnorePep8
103+
fromgit.repoimportRepo# @NoMove @IgnorePep8
104+
fromgit.remoteimport*# noqa: F403 # @NoMove @IgnorePep8
105+
fromgit.indeximport*# noqa: F403 # @NoMove @IgnorePep8
106+
fromgit.utilimport (# @NoMove @IgnorePep8
107+
LockFile,
108+
BlockingLockFile,
109+
Stats,
110+
Actor,
111+
remove_password_if_present,
112+
rmtree,
113+
)
114+
exceptGitErroras_exc:# noqa: F405
115+
raiseImportError("%s: %s"% (_exc.__class__.__name__,_exc))from_exc
116+
118117
# { Initialize git executable path
119118
GIT_OK=None
120119

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp