diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2020-02-26 16:07:57 +0000 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2020-02-26 16:38:04 +0000 |
commit | 9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc (patch) | |
tree | 7ebd9a5de60ae8145a2af2bb8b9342517cbac019 /pkgs/servers/home-assistant | |
parent | a8d4fc718b32e48f82f7fcdd41773f9a420c41a0 (diff) | |
download | nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.tar nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.tar.gz nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.tar.bz2 nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.tar.lz nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.tar.xz nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.tar.zst nixlib-9497ce5dd3b718c5424cb1b64912fdf3bbbd24fc.zip |
homeassistant/parse-requirements: run mypy check
Diffstat (limited to 'pkgs/servers/home-assistant')
-rwxr-xr-x | pkgs/servers/home-assistant/parse-requirements.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 3efdc01c9141..65c2bcfbfd45 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/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() |