7
7
8
8
9
9
from . import config
10
+ from .util import PathLike
10
11
11
12
12
13
class Runner :
@@ -47,7 +48,7 @@ def display_name(self) -> str:
47
48
48
49
49
50
@functools .cache
50
- def get_runners (cfgpath : " PathLike" | None = None ) -> list [Runner ]:
51
+ def get_runners (cfgpath : PathLike | None = None ) -> list [Runner ]:
51
52
conf = config .get_bench_runner_config (cfgpath ).get ("runners" , {})
52
53
runners = []
53
54
for nickname , section in conf .items ():
@@ -73,16 +74,16 @@ def get_runners(cfgpath: "PathLike" | None = None) -> list[Runner]:
73
74
return runners
74
75
75
76
76
- def get_runners_by_hostname (cfgpath : " PathLike" | None = None ) -> dict [str , Runner ]:
77
+ def get_runners_by_hostname (cfgpath : PathLike | None = None ) -> dict [str , Runner ]:
77
78
return {x .hostname : x for x in get_runners (cfgpath )}
78
79
79
80
80
- def get_runners_by_nickname (cfgpath : " PathLike" | None = None ) -> dict [str , Runner ]:
81
+ def get_runners_by_nickname (cfgpath : PathLike | None = None ) -> dict [str , Runner ]:
81
82
return {x .nickname : x for x in get_runners (cfgpath )}
82
83
83
84
84
85
def get_nickname_for_hostname (
85
- hostname : str | None = None , cfgpath : " PathLike" | None = None
86
+ hostname : str | None = None , cfgpath : PathLike | None = None
86
87
) -> str :
87
88
# The envvar BENCHMARK_MACHINE_NICKNAME is used to override the machine that
88
89
# results are reported for.
@@ -91,12 +92,12 @@ def get_nickname_for_hostname(
91
92
return get_runner_for_hostname (hostname , cfgpath ).nickname
92
93
93
94
94
- def get_runner_by_nickname (nickname : str , cfgpath : " PathLike" | None = None ) -> Runner :
95
+ def get_runner_by_nickname (nickname : str , cfgpath : PathLike | None = None ) -> Runner :
95
96
return get_runners_by_nickname (cfgpath ).get (nickname , unknown_runner )
96
97
97
98
98
99
def get_runner_for_hostname (
99
- hostname : str | None = None , cfgpath : " PathLike" | None = None
100
+ hostname : str | None = None , cfgpath : PathLike | None = None
100
101
) -> Runner :
101
102
if hostname is None :
102
103
hostname = socket .gethostname ()
0 commit comments