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
This commit is contained in:
parent
6fd5a4383b
commit
2293669674
1 changed files with 9 additions and 1 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue