|
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 | +from collections import defaultdict |
6 | 7 | import datetime
|
| 8 | +from io import BytesIO |
| 9 | +import logging |
| 10 | +import os |
7 | 11 | import re
|
8 | 12 | from subprocess import Popen, PIPE
|
| 13 | +import sys |
| 14 | +from time import altzone, daylight, localtime, time, timezone |
| 15 | + |
9 | 16 | from gitdb import IStream
|
10 |
| -from git.util import hex_to_bin, Actor, Stats, finalize_process |
11 |
| -from git.diff import Diffable |
12 | 17 | from git.cmd import Git
|
| 18 | +from git.diff import Diffable |
| 19 | +from git.util import hex_to_bin, Actor, Stats, finalize_process |
13 | 20 |
|
14 | 21 | from .tree import Tree
|
15 |
| -from . import base |
16 | 22 | from .util import (
|
17 | 23 | Serializable,
|
18 | 24 | TraversableIterableObj,
|
19 |
| - parse_date, |
20 | 25 | altz_to_utctz_str,
|
21 |
| - parse_actor_and_date, |
22 | 26 | from_timestamp,
|
| 27 | + parse_actor_and_date, |
| 28 | + parse_date, |
23 | 29 | )
|
24 |
| - |
25 |
| -from time import time, daylight, altzone, timezone, localtime |
26 |
| -import os |
27 |
| -from io import BytesIO |
28 |
| -import logging |
29 |
| -from collections import defaultdict |
30 |
| - |
| 30 | +from . import base |
31 | 31 |
|
32 | 32 | # typing ------------------------------------------------------------------
|
33 | 33 |
|
34 | 34 | from typing import (
|
35 | 35 | Any,
|
| 36 | + Dict, |
36 | 37 | IO,
|
37 | 38 | Iterator,
|
38 | 39 | List,
|
39 | 40 | Sequence,
|
40 | 41 | Tuple,
|
41 |
| - Union, |
42 | 42 | TYPE_CHECKING,
|
| 43 | + Union, |
43 | 44 | cast,
|
44 |
| - Dict, |
45 | 45 | )
|
46 | 46 |
|
47 |
| -from git.types import PathLike |
48 |
| - |
49 |
| -try: |
| 47 | +if sys.version_info >= (3, 8): |
50 | 48 | from typing import Literal
|
51 |
| -except ImportError: |
| 49 | +else: |
52 | 50 | from typing_extensions import Literal
|
53 | 51 |
|
| 52 | +from git.types import PathLike |
| 53 | + |
54 | 54 | if TYPE_CHECKING:
|
55 |
| - from git.repo import Repo |
56 | 55 | from git.refs import SymbolicReference
|
| 56 | + from git.repo import Repo |
57 | 57 |
|
58 | 58 | # ------------------------------------------------------------------------
|
59 | 59 |
|
|
0 commit comments