From 2293669674ee7881ff3cfc84cfcbcf2e34de2144 Mon Sep 17 00:00:00 2001 From: Scriptkiddi Date: Wed, 18 Dec 2019 22:24:26 +0100 Subject: home-assistant: Add error output for missing deps Print missing dependencies to the console when running the parse requirements script. This allows to spot missing packages that could be added to nixpkgs --- pkgs/servers/home-assistant/parse-requirements.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pkgs/servers/home-assistant/parse-requirements.py') diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 647e4513de4..96cf1d86050 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -105,7 +105,9 @@ components = parse_components(version=version) build_inputs = {} for component in sorted(components.keys()): attr_paths = [] - for req in sorted(get_reqs(components, component)): + missing_reqs = [] + reqs = sorted(get_reqs(components, component)) + for req in reqs: # Some requirements are specified by url, e.g. https://example.org/foobar#xyz==1.0.0 # Therefore, if there's a "#" in the line, only take the part after it req = req[req.find('#') + 1:] @@ -114,8 +116,14 @@ for component in sorted(components.keys()): if attr_path is not None: # Add attribute path without "python3Packages." prefix attr_paths.append(attr_path[len(PKG_SET + '.'):]) + else: + missing_reqs.append(name) else: build_inputs[component] = attr_paths + n_diff = len(reqs) > len(build_inputs[component]) + if n_diff > 0: + print("Component {} is missing {} dependencies".format(component, n_diff)) + print("missing requirements: {}".format(missing_reqs)) with open(os.path.dirname(sys.argv[0]) + '/component-packages.nix', 'w') as f: f.write('# Generated by parse-requirements.py\n') -- cgit 1.4.1