From 9b3a3bcaf5116bd2254fb06f53346b1461e28948 Mon Sep 17 00:00:00 2001 From: 0phoff <0phoff@users.noreply.github.com> Date: Wed, 27 Mar 2024 12:09:09 +0100 Subject: [PATCH] Fix mypy issues in CI --- pyproject.toml | 4 ++-- striker/plugins/progress.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 388430c..568738c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ mypy = "^1.6.1" ruff = "^0.3.4" [tool.mypy] +python_version = "3.9" follow_imports = 'silent' strict_optional = true warn_redundant_casts = true @@ -38,11 +39,10 @@ no_implicit_reexport = true disallow_untyped_defs = true ignore_missing_imports = true show_error_codes = true -python_version = "3.9" [tool.ruff] -line-length = 150 target-version = "py39" +line-length = 150 extend-exclude = [".sandbox"] [tool.ruff.lint] diff --git a/striker/plugins/progress.py b/striker/plugins/progress.py index 3e7afc6..da5df6b 100644 --- a/striker/plugins/progress.py +++ b/striker/plugins/progress.py @@ -8,7 +8,7 @@ import sys import time -from rich.progress import BarColumn, MofNCompleteColumn, Progress, ProgressColumn, TextColumn, filesize +from rich.progress import BarColumn, MofNCompleteColumn, Progress, ProgressColumn, TextColumn, filesize # type: ignore[attr-defined] from rich.table import Column from rich.text import Text @@ -306,9 +306,9 @@ def render_speed(cls, speed: Optional[float]) -> Text: unit, suffix = filesize.pick_unit_and_suffix(int(speed), ['s', 'm', 'h'], 60) speed /= unit - if suffix == 'h' and speed >= 36: # type: ignore[operator] - # Over 1.5 days, so we show in days instead of hours - speed /= 24 # type: ignore[operator] + # Over 1.5 days, so we show in days instead of hours + if suffix == 'h' and speed >= 36: + speed /= 24 suffix = 'd' return Text(f'({speed:.1f} {suffix}/it)', style='progress.remaining')