|
5 | 5 |
|
6 | 6 | # @PydevCodeAnalysisIgnore
|
7 | 7 |
|
8 |
| -__all__ = [ # noqa: F405 |
| 8 | +__all__ = [ |
9 | 9 | "Actor",
|
10 | 10 | "AmbiguousObjectName",
|
11 | 11 | "BadName",
|
|
88 | 88 |
|
89 | 89 | __version__ = "git"
|
90 | 90 |
|
91 |
| -from typing import List, Optional, Sequence, Tuple, Union, TYPE_CHECKING |
| 91 | +from typing import List, Optional, Sequence, TYPE_CHECKING, Tuple, Union |
92 | 92 |
|
93 | 93 | from gitdb.util import to_hex_sha
|
94 |
| -from git.exc import * # noqa: F403 # @NoMove @IgnorePep8 |
| 94 | + |
| 95 | +from git.exc import ( |
| 96 | + AmbiguousObjectName, |
| 97 | + BadName, |
| 98 | + BadObject, |
| 99 | + BadObjectType, |
| 100 | + CacheError, |
| 101 | + CheckoutError, |
| 102 | + CommandError, |
| 103 | + GitCommandError, |
| 104 | + GitCommandNotFound, |
| 105 | + GitError, |
| 106 | + HookExecutionError, |
| 107 | + InvalidDBRoot, |
| 108 | + InvalidGitRepositoryError, |
| 109 | + NoSuchPathError, |
| 110 | + ODBError, |
| 111 | + ParseError, |
| 112 | + RepositoryDirtyError, |
| 113 | + UnmergedEntriesError, |
| 114 | + UnsafeOptionError, |
| 115 | + UnsafeProtocolError, |
| 116 | + UnsupportedOperation, |
| 117 | + WorkTreeRepositoryUnsupported, |
| 118 | +) |
95 | 119 | from git.types import PathLike
|
96 | 120 |
|
97 | 121 | try:
|
98 |
| - from git.compat import safe_decode # @NoMove @IgnorePep8 |
99 |
| - from git.config import GitConfigParser # @NoMove @IgnorePep8 |
100 |
| - from git.objects import * # noqa: F403 # @NoMove @IgnorePep8 |
101 |
| - from git.refs import * # noqa: F403 # @NoMove @IgnorePep8 |
102 |
| - from git.diff import * # noqa: F403 # @NoMove @IgnorePep8 |
103 |
| - from git.db import * # noqa: F403 # @NoMove @IgnorePep8 |
104 |
| - from git.cmd import Git # @NoMove @IgnorePep8 |
105 |
| - from git.repo import Repo # @NoMove @IgnorePep8 |
106 |
| - from git.remote import * # noqa: F403 # @NoMove @IgnorePep8 |
107 |
| - from git.index import * # noqa: F403 # @NoMove @IgnorePep8 |
108 |
| - from git.util import ( # @NoMove @IgnorePep8 |
109 |
| - LockFile, |
| 122 | + from git.compat import safe_decode # @NoMove |
| 123 | + from git.config import GitConfigParser # @NoMove |
| 124 | + from git.objects import ( # @NoMove |
| 125 | + Blob, |
| 126 | + Commit, |
| 127 | + IndexObject, |
| 128 | + Object, |
| 129 | + RootModule, |
| 130 | + RootUpdateProgress, |
| 131 | + Submodule, |
| 132 | + TagObject, |
| 133 | + Tree, |
| 134 | + TreeModifier, |
| 135 | + UpdateProgress, |
| 136 | + ) |
| 137 | + from git.refs import ( # @NoMove |
| 138 | + HEAD, |
| 139 | + Head, |
| 140 | + RefLog, |
| 141 | + RefLogEntry, |
| 142 | + Reference, |
| 143 | + RemoteReference, |
| 144 | + SymbolicReference, |
| 145 | + Tag, |
| 146 | + TagReference, |
| 147 | + head, # noqa: F401 # Nonpublic. May disappear! Use git.refs.head. |
| 148 | + log, # noqa: F401 # Nonpublic. May disappear! Use git.refs.log. |
| 149 | + reference, # noqa: F401 # Nonpublic. May disappear! Use git.refs.reference. |
| 150 | + symbolic, # noqa: F401 # Nonpublic. May disappear! Use git.refs.symbolic. |
| 151 | + tag, # noqa: F401 # Nonpublic. May disappear! Use git.refs.tag. |
| 152 | + ) |
| 153 | + from git.diff import ( # @NoMove |
| 154 | + INDEX, |
| 155 | + NULL_TREE, |
| 156 | + Diff, |
| 157 | + DiffConstants, |
| 158 | + DiffIndex, |
| 159 | + Diffable, |
| 160 | + ) |
| 161 | + from git.db import GitCmdObjectDB, GitDB # @NoMove |
| 162 | + from git.cmd import Git # @NoMove |
| 163 | + from git.repo import Repo # @NoMove |
| 164 | + from git.remote import FetchInfo, PushInfo, Remote, RemoteProgress # @NoMove |
| 165 | + from git.index import ( # @NoMove |
| 166 | + BaseIndexEntry, |
| 167 | + BlobFilter, |
| 168 | + CheckoutError, |
| 169 | + IndexEntry, |
| 170 | + IndexFile, |
| 171 | + StageType, |
| 172 | + base, # noqa: F401 # Nonpublic. May disappear! Use git.index.base. |
| 173 | + fun, # noqa: F401 # Nonpublic. May disappear! Use git.index.fun. |
| 174 | + typ, # noqa: F401 # Nonpublic. May disappear! Use git.index.typ. |
| 175 | + # |
| 176 | + # NOTE: The expression `git.util` evaluates to git.index.util, and the import |
| 177 | + # `from git import util` imports git.index.util, NOT git.util. It may not be |
| 178 | + # feasible to change this until the next major version, to avoid breaking code |
| 179 | + # inadvertently relying on it. If git.index.util really is what you want, use or |
| 180 | + # import from that name, to avoid confusion. To use the "real" git.util module, |
| 181 | + # write `from git.util import ...`, or access it as `sys.modules["git.util"]`. |
| 182 | + # (This differs from other historical indirect-submodule imports that are |
| 183 | + # unambiguously nonpublic and are subject to immediate removal. Here, the public |
| 184 | + # git.util module, even though different, makes it less discoverable that the |
| 185 | + # expression `git.util` refers to a non-public attribute of the git module.) |
| 186 | + util, # noqa: F401 |
| 187 | + ) |
| 188 | + from git.util import ( # @NoMove |
| 189 | + Actor, |
110 | 190 | BlockingLockFile,
|
| 191 | + LockFile, |
111 | 192 | Stats,
|
112 |
| - Actor, |
113 | 193 | remove_password_if_present,
|
114 | 194 | rmtree,
|
115 | 195 | )
|
116 |
| -except GitError as _exc: # noqa: F405 |
| 196 | +except GitError as _exc: |
117 | 197 | raise ImportError("%s: %s" % (_exc.__class__.__name__, _exc)) from _exc
|
118 | 198 |
|
119 | 199 | # { Initialize git executable path
|
|
0 commit comments