meta: include path in RunnerInfo

This is so that once we have a `RunnerInfo` we can directly run
it without needed a back-reference to the index.
This commit is contained in:
Christian Kellner 2022-09-26 08:18:11 +00:00
parent 683a8cbfa7
commit 7c399f15df

View file

@ -493,15 +493,16 @@ class RunnerInfo:
specific distribution and version.
"""
def __init__(self, distro: str, version: int) -> None:
def __init__(self, distro: str, version: int, path: str) -> None:
self.distro = distro
self.version = version
self.path = path
@classmethod
def from_path(cls, path: str):
name = os.path.basename(path)
distro, version = cls.parse_name(name)
return cls(distro, version)
return cls(distro, version, path)
@staticmethod
def parse_name(name: str) -> Tuple[str, int]: