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

Add __all__ in git.exc #1719

Merged
merged 3 commits into from
Oct 20, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
# flake8: noqa
# @PydevCodeAnalysisIgnore
from git.exc import * # @NoMove @IgnorePep8
import inspect
import os
import sys
import os.path as osp
import sys

from typing import Optional
from typing import List, Optional, Sequence, Tuple, Union, TYPE_CHECKING
from git.types import PathLike

__version__ = "git"
Expand Down Expand Up @@ -39,7 +38,10 @@ def _init_externals() -> None:

# { Imports

from gitdb.util import to_hex_sha

try:
from git.compat import safe_decode # @NoMove @IgnorePep8
from git.config import GitConfigParser # @NoMove @IgnorePep8
from git.objects import * # @NoMove @IgnorePep8
from git.refs import * # @NoMove @IgnorePep8
Expand All @@ -54,6 +56,7 @@ def _init_externals() -> None:
BlockingLockFile,
Stats,
Actor,
remove_password_if_present,
rmtree,
)
except GitError as _exc:
Expand Down
2 changes: 1 addition & 1 deletion git/db.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module with our own gitdb implementation - it uses the git command"""
from git.util import bin_to_hex, hex_to_bin
from gitdb.base import OInfo, OStream
from gitdb.db import GitDB # @UnusedImport
from gitdb.db import GitDB
from gitdb.db import LooseObjectDB

from gitdb.exc import BadObject
Expand Down
30 changes: 28 additions & 2 deletions git/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,34 @@
# the BSD License: https://opensource.org/license/bsd-3-clause/
""" Module containing all exceptions thrown throughout the git package """

from gitdb.exc import ( # noqa: @UnusedImport
__all__ = [
# Defined in gitdb.exc:
EliahKagan marked this conversation as resolved.
Show resolved Hide resolved
"AmbiguousObjectName",
"BadName",
"BadObject",
"BadObjectType",
"InvalidDBRoot",
"ODBError",
"ParseError",
"UnsupportedOperation",
# Introduced in this module:
"GitError",
"InvalidGitRepositoryError",
"WorkTreeRepositoryUnsupported",
"NoSuchPathError",
"UnsafeProtocolError",
"UnsafeOptionError",
"CommandError",
"GitCommandNotFound",
"GitCommandError",
"CheckoutError",
"CacheError",
"UnmergedEntriesError",
"HookExecutionError",
"RepositoryDirtyError",
EliahKagan marked this conversation as resolved.
Show resolved Hide resolved
]

from gitdb.exc import (
AmbiguousObjectName,
BadName,
BadObject,
Expand All @@ -14,7 +41,6 @@
ODBError,
ParseError,
UnsupportedOperation,
to_hex_sha,
)
from git.compat import safe_decode
from git.util import remove_password_if_present
Expand Down