homeassistant/parse-requirements: run mypy check

wip/yesman
Jörg Thalheim 4 years ago
parent a8d4fc718b
commit 9497ce5dd3
No known key found for this signature in database
GPG Key ID: 003F2096411B5F92
  1. 14
      pkgs/servers/home-assistant/parse-requirements.py

@ -1,5 +1,5 @@
#! /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.
# 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():
with open(os.path.dirname(sys.argv[0]) + "/default.nix") as f:
# A version consists of digits, dots, and possibly a "b" (for beta)
@ -162,7 +168,7 @@ def main() -> None:
f.write(" components = {\n")
for component, deps in build_inputs.items():
available, missing = deps
f.write(f" \"{component}\" = ps: with ps; [ ")
f.write(f' "{component}" = ps: with ps; [ ')
f.write(" ".join(available))
f.write("];")
if len(missing) > 0:
@ -171,5 +177,7 @@ def main() -> None:
f.write(" };\n")
f.write("}\n")
if __name__ == '__main__':
if __name__ == "__main__":
run_mypy()
main()

Loading…
Cancel
Save