Skip to content

Commit 41d5667

Browse files
committed
Tidy up the last few Ruff problems in deploy.py
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
1 parent cc9c1f1 commit 41d5667

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/dvsim/job/deploy.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from pathlib import Path
1212
from typing import TYPE_CHECKING, ClassVar
1313

14+
from dvsim.flow.base import FlowCfg
1415
from dvsim.job.data import JobSpec, WorkspaceConfig
1516
from dvsim.job.status import JobStatus
1617
from dvsim.job.time import JobTime
@@ -538,9 +539,9 @@ class RunTest(Deploy):
538539

539540
# Initial seed values when running tests (if available).
540541
target = "run"
541-
seeds = []
542+
seeds: ClassVar[list[int]] = []
542543
fixed_seed = None
543-
cmds_list_vars = ["pre_run_cmds", "post_run_cmds"]
544+
cmds_list_vars: ClassVar[list[str]] = ["pre_run_cmds", "post_run_cmds"]
544545

545546
def __init__(self, index, test, build_job, sim_cfg: "SimCfg") -> None:
546547
self.test_obj = test
@@ -572,7 +573,10 @@ def __init__(self, index, test, build_job, sim_cfg: "SimCfg") -> None:
572573

573574
# We did something wrong if build_mode is not the same as the build_job
574575
# arg's name.
575-
assert self.build_mode == build_job.name
576+
if self.build_mode != build_job.name:
577+
msg = (f"Created a build job with name {build_job.name}, when we "
578+
f"expected the name to be {self.build_mode}.")
579+
raise AssertionError(msg)
576580

577581
def _define_attrs(self) -> None:
578582
super()._define_attrs()
@@ -678,7 +682,7 @@ def get_seed() -> int:
678682
RunTest.seeds.append(seed)
679683
return RunTest.seeds.pop(0)
680684

681-
def get_timeout_mins(self):
685+
def get_timeout_mins(self) -> float:
682686
"""Return the timeout in minutes.
683687
684688
Limit run jobs to 60 minutes if the timeout is not set.
@@ -737,7 +741,7 @@ class CovMerge(Deploy):
737741
target = "cov_merge"
738742
weight = 10
739743

740-
def __init__(self, run_items, sim_cfg) -> None:
744+
def __init__(self, run_items: list[RunTest], sim_cfg: FlowCfg) -> None:
741745
"""Initialise a job deployment to merge coverage databases."""
742746
# Construct the cov_db_dirs right away from the run_items. This is a
743747
# special variable used in the HJson. The coverage associated with

0 commit comments

Comments
 (0)