homeassistant/parse-requirements: run mypy check
This commit is contained in:
parent
a8d4fc718b
commit
9497ce5dd3
|
@ -1,5 +1,5 @@
|
||||||
#! /usr/bin/env nix-shell
|
#! /usr/bin/env nix-shell
|
||||||
#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ attrs ])
|
#! nix-shell -i python3 -p "python3.withPackages (ps: with ps; [ mypy attrs ])
|
||||||
#
|
#
|
||||||
# This script downloads Home Assistant's source tarball.
|
# This script downloads Home Assistant's source tarball.
|
||||||
# Inside the homeassistant/components directory, each integration has an associated manifest.json,
|
# Inside the homeassistant/components directory, each integration has an associated manifest.json,
|
||||||
|
@ -40,6 +40,12 @@ PKG_PREFERENCES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def run_mypy() -> None:
|
||||||
|
cmd = ["mypy", "--ignore-missing-imports", __file__]
|
||||||
|
print(f"$ {' '.join(cmd)}")
|
||||||
|
subprocess.run(cmd, check=True)
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
with open(os.path.dirname(sys.argv[0]) + "/default.nix") as f:
|
with open(os.path.dirname(sys.argv[0]) + "/default.nix") as f:
|
||||||
# A version consists of digits, dots, and possibly a "b" (for beta)
|
# A version consists of digits, dots, and possibly a "b" (for beta)
|
||||||
|
@ -162,7 +168,7 @@ def main() -> None:
|
||||||
f.write(" components = {\n")
|
f.write(" components = {\n")
|
||||||
for component, deps in build_inputs.items():
|
for component, deps in build_inputs.items():
|
||||||
available, missing = deps
|
available, missing = deps
|
||||||
f.write(f" \"{component}\" = ps: with ps; [ ")
|
f.write(f' "{component}" = ps: with ps; [ ')
|
||||||
f.write(" ".join(available))
|
f.write(" ".join(available))
|
||||||
f.write("];")
|
f.write("];")
|
||||||
if len(missing) > 0:
|
if len(missing) > 0:
|
||||||
|
@ -171,5 +177,7 @@ def main() -> None:
|
||||||
f.write(" };\n")
|
f.write(" };\n")
|
||||||
f.write("}\n")
|
f.write("}\n")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
run_mypy()
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue