6 files changed
@@ -5,18 +5,20 @@ | |||
| 5 | 5 | ||
| 6 | 6 | from __future__ import annotations | |
| 7 | 7 | ||
| 8 | - import re | ||
| 8 | + __all__ = ("Git",) | ||
| 9 | + | ||
| 9 | 10 | import contextlib | |
| 10 | 11 | import io | |
| 11 | 12 | import itertools | |
| 12 | 13 | import logging | |
| 13 | 14 | import os | |
| 15 | + import re | ||
| 14 | 16 | import signal | |
| 15 | - from subprocess import Popen, PIPE, DEVNULL | ||
| 16 | 17 | import subprocess | |
| 18 | + from subprocess import DEVNULL, PIPE, Popen | ||
| 17 | 19 | import sys | |
| 18 | - import threading | ||
| 19 | 20 | from textwrap import dedent | |
| 21 | + import threading | ||
| 20 | 22 | ||
| 21 | 23 | from git.compat import defenc, force_bytes, safe_decode | |
| 22 | 24 | from git.exc import ( | |
@@ -57,12 +59,11 @@ | |||
| 57 | 59 | overload, | |
| 58 | 60 | ) | |
| 59 | 61 | ||
| 60 | - from git.types import PathLike, Literal, TBD | ||
| 62 | + from git.types import Literal, PathLike, TBD | ||
| 61 | 63 | ||
| 62 | 64 | if TYPE_CHECKING: | |
| 63 | - from git.repo.base import Repo | ||
| 64 | 65 | from git.diff import DiffIndex | |
| 65 | - | ||
| 66 | + from git.repo.base import Repo | ||
| 66 | 67 | ||
| 67 | 68 | # --------------------------------------------------------------------------------- | |
| 68 | 69 | ||
@@ -84,8 +85,6 @@ | |||
| 84 | 85 | ||
| 85 | 86 | _logger = logging.getLogger(__name__) | |
| 86 | 87 | ||
| 87 | - __all__ = ("Git",) | ||
| 88 | - | ||
| 89 | 88 | ||
| 90 | 89 | # ============================================================================== | |
| 91 | 90 | ## @name Utilities | |
@@ -5,6 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | 6 | """Parser for reading and writing configuration files.""" | |
| 7 | 7 | ||
| 8 | + __all__ = ("GitConfigParser", "SectionConstraint") | ||
| 9 | + | ||
| 8 | 10 | import abc | |
| 9 | 11 | import configparser as cp | |
| 10 | 12 | import fnmatch | |
@@ -40,9 +42,10 @@ | |||
| 40 | 42 | from git.types import Lit_config_levels, ConfigLevels_Tup, PathLike, assert_never, _T | |
| 41 | 43 | ||
| 42 | 44 | if TYPE_CHECKING: | |
| 43 | - from git.repo.base import Repo | ||
| 44 | 45 | from io import BytesIO | |
| 45 | 46 | ||
| 47 | + from git.repo.base import Repo | ||
| 48 | + | ||
| 46 | 49 | T_ConfigParser = TypeVar("T_ConfigParser", bound="GitConfigParser") | |
| 47 | 50 | T_OMD_value = TypeVar("T_OMD_value", str, bytes, int, float, bool) | |
| 48 | 51 | ||
@@ -58,8 +61,6 @@ | |||
| 58 | 61 | ||
| 59 | 62 | # ------------------------------------------------------------- | |
| 60 | 63 | ||
| 61 | - __all__ = ("GitConfigParser", "SectionConstraint") | ||
| 62 | - | ||
| 63 | 64 | _logger = logging.getLogger(__name__) | |
| 64 | 65 | ||
| 65 | 66 | CONFIG_LEVELS: ConfigLevels_Tup = ("system", "user", "global", "repository") | |
@@ -3,27 +3,26 @@ | |||
| 3 | 3 | ||
| 4 | 4 | """Module with our own gitdb implementation - it uses the git command.""" | |
| 5 | 5 | ||
| 6 | - from git.util import bin_to_hex, hex_to_bin | ||
| 7 | - from gitdb.base import OInfo, OStream | ||
| 8 | - from gitdb.db import GitDB | ||
| 9 | - from gitdb.db import LooseObjectDB | ||
| 6 | + __all__ = ("GitCmdObjectDB", "GitDB") | ||
| 10 | 7 | ||
| 8 | + from gitdb.base import OInfo, OStream | ||
| 9 | + from gitdb.db import GitDB, LooseObjectDB | ||
| 11 | 10 | from gitdb.exc import BadObject | |
| 11 | + | ||
| 12 | + from git.util import bin_to_hex, hex_to_bin | ||
| 12 | 13 | from git.exc import GitCommandError | |
| 13 | 14 | ||
| 14 | 15 | # typing------------------------------------------------- | |
| 15 | 16 | ||
| 16 | 17 | from typing import TYPE_CHECKING | |
| 18 | + | ||
| 17 | 19 | from git.types import PathLike | |
| 18 | 20 | ||
| 19 | 21 | if TYPE_CHECKING: | |
| 20 | 22 | from git.cmd import Git | |
| 21 | 23 | ||
| 22 | - | ||
| 23 | 24 | # -------------------------------------------------------- | |
| 24 | 25 | ||
| 25 | - __all__ = ("GitCmdObjectDB", "GitDB") | ||
| 26 | - | ||
| 27 | 26 | ||
| 28 | 27 | class GitCmdObjectDB(LooseObjectDB): | |
| 29 | 28 | """A database representing the default git object store, which includes loose | |
@@ -3,17 +3,17 @@ | |||
| 3 | 3 | # This module is part of GitPython and is released under the | |
| 4 | 4 | # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ | |
| 5 | 5 | ||
| 6 | + __all__ = ("DiffConstants", "NULL_TREE", "INDEX", "Diffable", "DiffIndex", "Diff") | ||
| 7 | + | ||
| 6 | 8 | import enum | |
| 7 | 9 | import re | |
| 8 | 10 | ||
| 9 | 11 | from git.cmd import handle_process_output | |
| 10 | 12 | from git.compat import defenc | |
| 13 | + from git.objects.blob import Blob | ||
| 14 | + from git.objects.util import mode_str_to_int | ||
| 11 | 15 | from git.util import finalize_process, hex_to_bin | |
| 12 | 16 | ||
| 13 | - from .objects.blob import Blob | ||
| 14 | - from .objects.util import mode_str_to_int | ||
| 15 | - | ||
| 16 | - | ||
| 17 | 17 | # typing ------------------------------------------------------------------ | |
| 18 | 18 | ||
| 19 | 19 | from typing import ( | |
@@ -23,29 +23,27 @@ | |||
| 23 | 23 | Match, | |
| 24 | 24 | Optional, | |
| 25 | 25 | Tuple, | |
| 26 | + TYPE_CHECKING, | ||
| 26 | 27 | TypeVar, | |
| 27 | 28 | Union, | |
| 28 | - TYPE_CHECKING, | ||
| 29 | 29 | cast, | |
| 30 | 30 | ) | |
| 31 | 31 | from git.types import Literal, PathLike | |
| 32 | 32 | ||
| 33 | 33 | if TYPE_CHECKING: | |
| 34 | - from .objects.tree import Tree | ||
| 35 | - from .objects import Commit | ||
| 36 | - from git.repo.base import Repo | ||
| 37 | - from git.objects.base import IndexObject | ||
| 38 | 34 | from subprocess import Popen | |
| 39 | - from git import Git | ||
| 35 | + | ||
| 36 | + from git.cmd import Git | ||
| 37 | + from git.objects.base import IndexObject | ||
| 38 | + from git.objects.commit import Commit | ||
| 39 | + from git.objects.tree import Tree | ||
| 40 | + from git.repo.base import Repo | ||
| 40 | 41 | ||
| 41 | 42 | Lit_change_type = Literal["A", "D", "C", "M", "R", "T", "U"] | |
| 42 | 43 | ||
| 43 | 44 | # ------------------------------------------------------------------------ | |
| 44 | 45 | ||
| 45 | 46 | ||
| 46 | - __all__ = ("DiffConstants", "NULL_TREE", "INDEX", "Diffable", "DiffIndex", "Diff") | ||
| 47 | - | ||
| 48 | - | ||
| 49 | 47 | @enum.unique | |
| 50 | 48 | class DiffConstants(enum.Enum): | |
| 51 | 49 | """Special objects for :meth:`Diffable.diff`. | |
@@ -42,12 +42,14 @@ | |||
| 42 | 42 | ParseError, | |
| 43 | 43 | UnsupportedOperation, | |
| 44 | 44 | ) | |
| 45 | + | ||
| 45 | 46 | from git.compat import safe_decode | |
| 46 | 47 | from git.util import remove_password_if_present | |
| 47 | 48 | ||
| 48 | 49 | # typing ---------------------------------------------------- | |
| 49 | 50 | ||
| 50 | - from typing import List, Sequence, Tuple, Union, TYPE_CHECKING | ||
| 51 | + from typing import List, Sequence, Tuple, TYPE_CHECKING, Union | ||
| 52 | + | ||
| 51 | 53 | from git.types import PathLike | |
| 52 | 54 | ||
| 53 | 55 | if TYPE_CHECKING: | |
@@ -5,6 +5,8 @@ | |||
| 5 | 5 | ||
| 6 | 6 | """Module implementing a remote object allowing easy access to git remotes.""" | |
| 7 | 7 | ||
| 8 | + __all__ = ("RemoteProgress", "PushInfo", "FetchInfo", "Remote") | ||
| 9 | + | ||
| 8 | 10 | import contextlib | |
| 9 | 11 | import logging | |
| 10 | 12 | import re | |
@@ -54,8 +56,6 @@ | |||
| 54 | 56 | ||
| 55 | 57 | _logger = logging.getLogger(__name__) | |
| 56 | 58 | ||
| 57 | - __all__ = ("RemoteProgress", "PushInfo", "FetchInfo", "Remote") | ||
| 58 | - | ||
| 59 | 59 | # { Utilities | |
| 60 | 60 | ||
| 61 | 61 | ||
0 commit comments