From 89f248c7bfdae65c911e4efc5398823dc5d54c28 Mon Sep 17 00:00:00 2001 From: Devesh Kumar Singh Date: Sun, 29 Mar 2020 21:35:22 +0530 Subject: [PATCH] Removing type ignore comments from cli.progress_bars --- ...770AC380-E84F-44C7-A20C-CD31A829EDA5.trivial | 1 + src/pip/_internal/cli/progress_bars.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 news/770AC380-E84F-44C7-A20C-CD31A829EDA5.trivial diff --git a/news/770AC380-E84F-44C7-A20C-CD31A829EDA5.trivial b/news/770AC380-E84F-44C7-A20C-CD31A829EDA5.trivial new file mode 100644 index 000000000..5e5d3c4f0 --- /dev/null +++ b/news/770AC380-E84F-44C7-A20C-CD31A829EDA5.trivial @@ -0,0 +1 @@ +Remove "type: ignore" comments from cli subpackage diff --git a/src/pip/_internal/cli/progress_bars.py b/src/pip/_internal/cli/progress_bars.py index 7ed224790..9a4ae592e 100644 --- a/src/pip/_internal/cli/progress_bars.py +++ b/src/pip/_internal/cli/progress_bars.py @@ -78,6 +78,7 @@ class InterruptibleMixin(object): """ Save the original SIGINT handler for later. """ + # https://github.com/python/mypy/issues/5887 super(InterruptibleMixin, self).__init__( # type: ignore *args, **kwargs @@ -134,6 +135,7 @@ class DownloadProgressMixin(object): def __init__(self, *args, **kwargs): # type: (List[Any], Dict[Any, Any]) -> None + # https://github.com/python/mypy/issues/5887 super(DownloadProgressMixin, self).__init__( # type: ignore *args, **kwargs @@ -183,6 +185,7 @@ class WindowsMixin(object): if WINDOWS and self.hide_cursor: # type: ignore self.hide_cursor = False + # https://github.com/python/mypy/issues/5887 super(WindowsMixin, self).__init__(*args, **kwargs) # type: ignore # Check if we are running on Windows and we have the colorama module, @@ -206,30 +209,27 @@ class BaseDownloadProgressBar(WindowsMixin, InterruptibleMixin, message = "%(percent)d%%" 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, _BaseBar): pass -class DownloadSilentBar(BaseDownloadProgressBar, SilentBar): # type: ignore +class DownloadSilentBar(BaseDownloadProgressBar, SilentBar): pass -class DownloadBar(BaseDownloadProgressBar, # type: ignore +class DownloadBar(BaseDownloadProgressBar, Bar): pass -class DownloadFillingCirclesBar(BaseDownloadProgressBar, # type: ignore +class DownloadFillingCirclesBar(BaseDownloadProgressBar, FillingCirclesBar): pass -class DownloadBlueEmojiProgressBar(BaseDownloadProgressBar, # type: ignore +class DownloadBlueEmojiProgressBar(BaseDownloadProgressBar, BlueEmojiBar): pass @@ -240,7 +240,8 @@ class DownloadProgressSpinner(WindowsMixin, InterruptibleMixin, file = sys.stdout suffix = "%(downloaded)s %(download_speed)s" - def next_phase(self): # type: ignore + def next_phase(self): + # type: () -> str if not hasattr(self, "_phaser"): self._phaser = itertools.cycle(self.phases) return next(self._phaser)