mirror of https://github.com/pypa/pip
Merge pull request #7932 from deveshks/remove-type-ignore-from-cli
This commit is contained in:
commit
d911a9fcb8
|
@ -0,0 +1 @@
|
||||||
|
Remove "type: ignore" comments from cli subpackage
|
|
@ -78,6 +78,7 @@ class InterruptibleMixin(object):
|
||||||
"""
|
"""
|
||||||
Save the original SIGINT handler for later.
|
Save the original SIGINT handler for later.
|
||||||
"""
|
"""
|
||||||
|
# https://github.com/python/mypy/issues/5887
|
||||||
super(InterruptibleMixin, self).__init__( # type: ignore
|
super(InterruptibleMixin, self).__init__( # type: ignore
|
||||||
*args,
|
*args,
|
||||||
**kwargs
|
**kwargs
|
||||||
|
@ -134,6 +135,7 @@ class DownloadProgressMixin(object):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
# type: (List[Any], Dict[Any, Any]) -> None
|
# type: (List[Any], Dict[Any, Any]) -> None
|
||||||
|
# https://github.com/python/mypy/issues/5887
|
||||||
super(DownloadProgressMixin, self).__init__( # type: ignore
|
super(DownloadProgressMixin, self).__init__( # type: ignore
|
||||||
*args,
|
*args,
|
||||||
**kwargs
|
**kwargs
|
||||||
|
@ -183,6 +185,7 @@ class WindowsMixin(object):
|
||||||
if WINDOWS and self.hide_cursor: # type: ignore
|
if WINDOWS and self.hide_cursor: # type: ignore
|
||||||
self.hide_cursor = False
|
self.hide_cursor = False
|
||||||
|
|
||||||
|
# https://github.com/python/mypy/issues/5887
|
||||||
super(WindowsMixin, self).__init__(*args, **kwargs) # type: ignore
|
super(WindowsMixin, self).__init__(*args, **kwargs) # type: ignore
|
||||||
|
|
||||||
# Check if we are running on Windows and we have the colorama module,
|
# Check if we are running on Windows and we have the colorama module,
|
||||||
|
@ -206,30 +209,27 @@ class BaseDownloadProgressBar(WindowsMixin, InterruptibleMixin,
|
||||||
message = "%(percent)d%%"
|
message = "%(percent)d%%"
|
||||||
suffix = "%(downloaded)s %(download_speed)s %(pretty_eta)s"
|
suffix = "%(downloaded)s %(download_speed)s %(pretty_eta)s"
|
||||||
|
|
||||||
# NOTE: The "type: ignore" comments on the following classes are there to
|
|
||||||
# work around https://github.com/python/typing/issues/241
|
|
||||||
|
|
||||||
|
|
||||||
class DefaultDownloadProgressBar(BaseDownloadProgressBar,
|
class DefaultDownloadProgressBar(BaseDownloadProgressBar,
|
||||||
_BaseBar):
|
_BaseBar):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DownloadSilentBar(BaseDownloadProgressBar, SilentBar): # type: ignore
|
class DownloadSilentBar(BaseDownloadProgressBar, SilentBar):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DownloadBar(BaseDownloadProgressBar, # type: ignore
|
class DownloadBar(BaseDownloadProgressBar,
|
||||||
Bar):
|
Bar):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DownloadFillingCirclesBar(BaseDownloadProgressBar, # type: ignore
|
class DownloadFillingCirclesBar(BaseDownloadProgressBar,
|
||||||
FillingCirclesBar):
|
FillingCirclesBar):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DownloadBlueEmojiProgressBar(BaseDownloadProgressBar, # type: ignore
|
class DownloadBlueEmojiProgressBar(BaseDownloadProgressBar,
|
||||||
BlueEmojiBar):
|
BlueEmojiBar):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -240,7 +240,8 @@ class DownloadProgressSpinner(WindowsMixin, InterruptibleMixin,
|
||||||
file = sys.stdout
|
file = sys.stdout
|
||||||
suffix = "%(downloaded)s %(download_speed)s"
|
suffix = "%(downloaded)s %(download_speed)s"
|
||||||
|
|
||||||
def next_phase(self): # type: ignore
|
def next_phase(self):
|
||||||
|
# type: () -> str
|
||||||
if not hasattr(self, "_phaser"):
|
if not hasattr(self, "_phaser"):
|
||||||
self._phaser = itertools.cycle(self.phases)
|
self._phaser = itertools.cycle(self.phases)
|
||||||
return next(self._phaser)
|
return next(self._phaser)
|
||||||
|
|
Loading…
Reference in New Issue