Ruff and pytest are finally happy · commit-0/python-progressbar@7f00648 · GitHub
Skip to content

Commit 7f00648

Browse files
committed
Ruff and pytest are finally happy
1 parent d8a7653 commit 7f00648

11 files changed

Lines changed: 306 additions & 243 deletions

File tree

progressbar/bar.py

Lines changed: 3 additions & 3 deletions

progressbar/multi.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
import timeit
1111
import typing
1212
from datetime import timedelta
13-
from typing import List, Any
1413

1514
import python_utils
16-
from python_utils import decorators
1715

1816
from . import bar, terminal
1917
from .terminal import stream
@@ -132,7 +130,7 @@ def __setitem__(self, key: str, bar: bar.ProgressBar):
132130
bar.fd = stream.LastLineStream(self.fd)
133131
bar.paused = True
134132
# Essentially `bar.print = self.print`, but `mypy` doesn't like that
135-
setattr(bar, 'print', self.print)
133+
bar.print = self.print
136134

137135
# Just in case someone is using a progressbar with a custom
138136
# constructor and forgot to call the super constructor
@@ -182,7 +180,7 @@ def render(self, flush: bool = True, force: bool = False):
182180
continue
183181

184182
output.extend(
185-
iter(self._render_bar(bar_, expired=expired, now=now))
183+
iter(self._render_bar(bar_, expired=expired, now=now)),
186184
)
187185

188186
with self._print_lock:
@@ -218,7 +216,7 @@ def render(self, flush: bool = True, force: bool = False):
218216
self.flush()
219217

220218
def _render_bar(
221-
self, bar_: bar.ProgressBar, now, expired
219+
self, bar_: bar.ProgressBar, now, expired,
222220
) -> typing.Iterable[str]:
223221
def update(force=True, write=True):
224222
self._label_bar(bar_)

progressbar/terminal/colors.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
cyan1 = Colors.register(RGB(0, 255, 255), HLS(100, 180, 50), 'Cyan1', 51)
163163
dark_red = Colors.register(RGB(95, 0, 0), HLS(100, 0, 18), 'DarkRed', 52)
164164
deep_pink4 = Colors.register(
165-
RGB(95, 0, 95), HLS(100, 300, 18), 'DeepPink4', 53
165+
RGB(95, 0, 95), HLS(100, 300, 18), 'DeepPink4', 53,
166166
)
167167
purple4 = Colors.register(RGB(95, 0, 135), HLS(100, 82, 26), 'Purple4', 54)
168168
purple4 = Colors.register(RGB(95, 0, 175), HLS(100, 72, 34), 'Purple4', 55)
@@ -260,7 +260,7 @@
260260
73,
261261
)
262262
sky_blue3 = Colors.register(
263-
RGB(95, 175, 215), HLS(60, 200, 60), 'SkyBlue3', 74
263+
RGB(95, 175, 215), HLS(60, 200, 60), 'SkyBlue3', 74,
264264
)
265265
steel_blue1 = Colors.register(
266266
RGB(95, 175, 255),
@@ -342,7 +342,7 @@
342342
)
343343
dark_red = Colors.register(RGB(135, 0, 0), HLS(100, 0, 26), 'DarkRed', 88)
344344
deep_pink4 = Colors.register(
345-
RGB(135, 0, 95), HLS(100, 17, 26), 'DeepPink4', 89
345+
RGB(135, 0, 95), HLS(100, 17, 26), 'DeepPink4', 89,
346346
)
347347
dark_magenta = Colors.register(
348348
RGB(135, 0, 135),
@@ -546,7 +546,7 @@
546546
130,
547547
)
548548
indian_red = Colors.register(
549-
RGB(175, 95, 95), HLS(33, 0, 52), 'IndianRed', 131
549+
RGB(175, 95, 95), HLS(33, 0, 52), 'IndianRed', 131,
550550
)
551551
hot_pink3 = Colors.register(
552552
RGB(175, 95, 135),
@@ -724,7 +724,7 @@
724724
166,
725725
)
726726
indian_red = Colors.register(
727-
RGB(215, 95, 95), HLS(60, 0, 60), 'IndianRed', 167
727+
RGB(215, 95, 95), HLS(60, 0, 60), 'IndianRed', 167,
728728
)
729729
hot_pink3 = Colors.register(
730730
RGB(215, 95, 135),
@@ -879,10 +879,10 @@
879879
204,
880880
)
881881
hot_pink = Colors.register(
882-
RGB(255, 95, 175), HLS(100, 330, 68), 'HotPink', 205
882+
RGB(255, 95, 175), HLS(100, 330, 68), 'HotPink', 205,
883883
)
884884
hot_pink = Colors.register(
885-
RGB(255, 95, 215), HLS(100, 315, 68), 'HotPink', 206
885+
RGB(255, 95, 215), HLS(100, 315, 68), 'HotPink', 206,
886886
)
887887
medium_orchid1 = Colors.register(
888888
RGB(255, 95, 255),

progressbar/terminal/os_specific/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
__test__ = False
21
import sys
32

43
if sys.platform.startswith('win'):

progressbar/terminal/stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def truncate(self, __size: int | None = None) -> int:
121121
def writelines(self, __lines: Iterable[str]) -> None:
122122
line = ''
123123
# Walk through the lines and take the last one
124-
for line in __lines:
124+
for line in __lines: # noqa: B007
125125
pass
126126

127127
self.line = line

progressbar/utils.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)