Skip to content

Commit 36aa103

Browse files
committed
Start replacing wildcard imports
1 parent e8f20a2 commit 36aa103

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

git/index/__init__.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@
33

44
"""Initialize the index package."""
55

6-
from .base import * # noqa: F401 F403
7-
from .typ import * # noqa: F401 F403
6+
__all__ = [
7+
"BaseIndexEntry",
8+
"BlobFilter",
9+
"CheckoutError",
10+
"IndexEntry",
11+
"IndexFile",
12+
"StageType",
13+
]
14+
15+
from .base import CheckoutError, IndexFile
16+
from .typ import BaseIndexEntry, BlobFilter, IndexEntry, StageType

git/index/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"""Module containing :class:`IndexFile`, an Index implementation facilitating all kinds
77
of index manipulations such as querying and merging."""
88

9+
__all__ = ("IndexFile", "CheckoutError", "StageType")
10+
911
import contextlib
1012
import datetime
1113
import glob
@@ -94,9 +96,6 @@
9496
# ------------------------------------------------------------------------------------
9597

9698

97-
__all__ = ("IndexFile", "CheckoutError", "StageType")
98-
99-
10099
@contextlib.contextmanager
101100
def _named_temporary_file_for_subprocess(directory: PathLike) -> Generator[str, None, None]:
102101
"""Create a named temporary file git subprocesses can open, deleting it afterward.

git/index/typ.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
"""Additional types used by the index."""
55

6+
__all__ = ("BlobFilter", "BaseIndexEntry", "IndexEntry", "StageType")
7+
68
from binascii import b2a_hex
79
from pathlib import Path
810

911
from .util import pack, unpack
1012
from git.objects import Blob
1113

12-
1314
# typing ----------------------------------------------------------------------
1415

1516
from typing import NamedTuple, Sequence, TYPE_CHECKING, Tuple, Union, cast, List
@@ -23,8 +24,6 @@
2324

2425
# ---------------------------------------------------------------------------------
2526

26-
__all__ = ("BlobFilter", "BaseIndexEntry", "IndexEntry", "StageType")
27-
2827
# { Invariants
2928
CE_NAMEMASK = 0x0FFF
3029
CE_STAGEMASK = 0x3000

0 commit comments

Comments
 (0)