Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamically-set __all__ variable #1659

Merged
merged 8 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 79 additions & 2 deletions git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,85 @@ def _init_externals() -> None:

# } END imports

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

# __all__ must be statically defined by py.typed support
# __all__ = [name for name, obj in locals().items() if not (name.startswith("_") or inspect.ismodule(obj))]
__all__ = [
"Actor",
"AmbiguousObjectName",
"BadName",
"BadObject",
"BadObjectType",
"BaseIndexEntry",
"Blob",
"BlobFilter",
"BlockingLockFile",
"CacheError",
"CheckoutError",
"CommandError",
"Commit",
"Diff",
"DiffIndex",
"Diffable",
"FetchInfo",
"Git",
"GitCmdObjectDB",
"GitCommandError",
"GitCommandNotFound",
"GitConfigParser",
"GitDB",
"GitError",
"HEAD",
"Head",
"HookExecutionError",
"IndexEntry",
"IndexFile",
"IndexObject",
"InvalidDBRoot",
"InvalidGitRepositoryError",
"List",
"LockFile",
"NULL_TREE",
"NoSuchPathError",
"ODBError",
"Object",
"Optional",
"ParseError",
"PathLike",
"PushInfo",
"RefLog",
"RefLogEntry",
"Reference",
"Remote",
"RemoteProgress",
"RemoteReference",
"Repo",
"RepositoryDirtyError",
"RootModule",
"RootUpdateProgress",
"Sequence",
"StageType",
"Stats",
"Submodule",
"SymbolicReference",
"TYPE_CHECKING",
"Tag",
"TagObject",
"TagReference",
"Tree",
"TreeModifier",
"Tuple",
"Union",
"UnmergedEntriesError",
"UnsafeOptionError",
"UnsafeProtocolError",
"UnsupportedOperation",
"UpdateProgress",
"WorkTreeRepositoryUnsupported",
"remove_password_if_present",
"rmtree",
"safe_decode",
"to_hex_sha",
]

# { Initialize git executable path
GIT_OK = None
Expand Down
19 changes: 14 additions & 5 deletions git/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: https://opensource.org/license/bsd-3-clause/
""" Module containing all exceptions thrown throughout the git package, """

from gitdb.exc import BadName # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
""" Module containing all exceptions thrown throughout the git package """

from gitdb.exc import ( # noqa: @UnusedImport
AmbiguousObjectName,
BadName,
BadObject,
BadObjectType,
InvalidDBRoot,
ODBError,
ParseError,
UnsupportedOperation,
to_hex_sha,
)
from git.compat import safe_decode
from git.util import remove_password_if_present

Expand Down
Loading