Skip to content

Commit

Permalink
Merge pull request #1719 from EliahKagan/static-all
Browse files Browse the repository at this point in the history
Add `__all__` in git.exc
  • Loading branch information
Byron authored Oct 20, 2023
2 parents 44102f3 + 2af3679 commit df777fd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
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:
"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",
]

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

0 comments on commit df777fd

Please sign in to comment.