forked from Mirror/pmbootstrap
commands: repo_bootstrap: type hint (MR 2463)
make mypy happy Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
8b880b7198
commit
2f39edd584
1 changed files with 5 additions and 5 deletions
|
@ -57,7 +57,7 @@ class RepoBootstrap(commands.Command):
|
||||||
|
|
||||||
self.check_repo_arg()
|
self.check_repo_arg()
|
||||||
|
|
||||||
def get_packages(self, bootstrap_line):
|
def get_packages(self, bootstrap_line: str) -> list[str]:
|
||||||
ret = []
|
ret = []
|
||||||
for word in bootstrap_line.split(" "):
|
for word in bootstrap_line.split(" "):
|
||||||
if word.startswith("["):
|
if word.startswith("["):
|
||||||
|
@ -65,7 +65,7 @@ class RepoBootstrap(commands.Command):
|
||||||
ret += [word]
|
ret += [word]
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def set_progress_total(self, steps):
|
def set_progress_total(self, steps: dict[str, str]) -> None:
|
||||||
self.progress_total = 0
|
self.progress_total = 0
|
||||||
|
|
||||||
# Add one progress point per package
|
# Add one progress point per package
|
||||||
|
@ -85,7 +85,7 @@ class RepoBootstrap(commands.Command):
|
||||||
|
|
||||||
self.progress_done += 1
|
self.progress_done += 1
|
||||||
|
|
||||||
def run_steps(self, steps):
|
def run_steps(self, steps: dict[str, str]) -> None:
|
||||||
chroot: Chroot
|
chroot: Chroot
|
||||||
if self.arch.cpu_emulation_required():
|
if self.arch.cpu_emulation_required():
|
||||||
chroot = Chroot(ChrootType.BUILDROOT, self.arch)
|
chroot = Chroot(ChrootType.BUILDROOT, self.arch)
|
||||||
|
@ -149,10 +149,10 @@ class RepoBootstrap(commands.Command):
|
||||||
|
|
||||||
raise RuntimeError(f"{msg}!")
|
raise RuntimeError(f"{msg}!")
|
||||||
|
|
||||||
def get_steps(self):
|
def get_steps(self) -> dict[str, str]:
|
||||||
cfg = pmb.config.pmaports.read_config_repos()
|
cfg = pmb.config.pmaports.read_config_repos()
|
||||||
prev_step = 0
|
prev_step = 0
|
||||||
ret = {}
|
ret: dict[str, str] = {}
|
||||||
|
|
||||||
for key, packages in cfg[self.repo].items():
|
for key, packages in cfg[self.repo].items():
|
||||||
if not key.startswith("bootstrap_"):
|
if not key.startswith("bootstrap_"):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue