-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mypy: add typing annotations and fix mypy errors
- Loading branch information
Showing
15 changed files
with
88 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,11 @@ def run(cmd: str, env: dict[str, str] = os.environ.copy()) -> Result: | |
) | ||
|
||
|
||
def reset(args): | ||
def reset(args: argparse.Namespace) -> None: | ||
run("ssh [email protected] sudo reboot") | ||
|
||
|
||
def console(args): | ||
def console(args: argparse.Namespace) -> None: | ||
if args.target == "imc": | ||
minicom_cmd = "minicom -b 460800 -D /dev/ttyUSB2" | ||
else: | ||
|
@@ -73,7 +73,7 @@ def find_bus_pci_address(address: str) -> str: | |
return "Invalid PCI address format" | ||
|
||
|
||
def list_dpus(args): | ||
def list_dpus(args: argparse.Namespace) -> None: | ||
del args | ||
devs = {} | ||
for e in run("lspci").out.split("\n"): | ||
|
@@ -90,7 +90,7 @@ def list_dpus(args): | |
print(f"{i: 5d} {k.ljust(8)} {d.ljust(12)} {kind}") | ||
|
||
|
||
def main(): | ||
def main() -> None: | ||
parser = argparse.ArgumentParser(description="Tools to interact with an IPU") | ||
subparsers = parser.add_subparsers( | ||
title="subcommands", description="Valid subcommands", dest="subcommand" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[mypy] | ||
strict = true | ||
scripts_are_modules = true | ||
files = *.py, bfb, console, cx_fwup, fwdefaults, fwup, fwversion, get_mode, listbf, pxeboot, reset, set_mode, dpu-tools/dpu-tools | ||
|
||
[mypy-pexpect] | ||
ignore_missing_imports = true |
Oops, something went wrong.