diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2020-03-11 10:49:33 +0000 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2020-03-11 10:56:24 +0000 |
commit | 93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b (patch) | |
tree | 968905e323ee1c552d95df5ac7f3505fb6f6de2d /pkgs/servers/home-assistant | |
parent | 5f77ff63849396c2b0dd243c0bb9fdae13c0fab6 (diff) | |
download | nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.tar nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.tar.gz nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.tar.bz2 nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.tar.lz nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.tar.xz nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.tar.zst nixlib-93a0ec6b594ebcf2ce317fbfdb71efa661b4dd1b.zip |
home-assistant: fix parse-requirements.py for newer home-assistant versions
Diffstat (limited to 'pkgs/servers/home-assistant')
-rwxr-xr-x | pkgs/servers/home-assistant/parse-requirements.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 65c2bcfbfd45..a5c6e9d09614 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -53,7 +53,7 @@ def get_version(): return m.group(1) -def parse_components(version="master"): +def parse_components(version: str = "master"): components = {} with tempfile.TemporaryDirectory() as tmp: with urlopen( @@ -61,14 +61,13 @@ def parse_components(version="master"): ) as response: tarfile.open(fileobj=BytesIO(response.read())).extractall(tmp) # Use part of a script from the Home Assistant codebase - sys.path.append(os.path.join(tmp, f"home-assistant-{version}")) + core_path = os.path.join(tmp, f"core-{version}") + sys.path.append(core_path) from script.hassfest.model import Integration integrations = Integration.load_dir( pathlib.Path( - os.path.join( - tmp, f"home-assistant-{version}", "homeassistant/components" - ) + os.path.join(core_path, "homeassistant/components") ) ) for domain in sorted(integrations): |