Skip to content

Commit c26afcc

Browse files
sinscary=
authored and
=
committed
add only required imports to spinners and progress bar
1 parent cf4dc76 commit c26afcc

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

src/pip/_internal/cli/progress_bars.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# The following comment should be removed at some point in the future.
2-
# mypy: strict-optional=False
3-
4-
from __future__ import absolute_import, division
1+
from __future__ import division
52

63
import contextlib
74
import itertools
@@ -11,7 +8,6 @@
118
from signal import SIGINT, default_int_handler, signal
129

1310
from pip._vendor import six
14-
from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR
1511
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
1612
from pip._vendor.progress.spinner import Spinner
1713

@@ -30,9 +26,6 @@
3026
except Exception:
3127
colorama = None
3228

33-
logger = logging.getLogger(__name__)
34-
35-
3629
def _select_progress_class(preferred, fallback):
3730
encoding = getattr(preferred.file, "encoding", None)
3831

src/pip/_internal/cli/spinners.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
from __future__ import absolute_import, division
2+
3+
import contextlib
4+
import itertools
5+
import logging
6+
import sys
7+
import time
8+
9+
from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR
10+
11+
from pip._internal.utils.compat import WINDOWS
12+
from pip._internal.utils.logging import get_indentation
13+
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
14+
if MYPY_CHECK_RUNNING:
15+
from typing import Iterator, IO
16+
17+
logger = logging.getLogger(__name__)
18+
119
class SpinnerInterface(object):
220
def spin(self):
321
# type: () -> None

0 commit comments

Comments
 (0)