Merge pull request #75898 from Scriptkiddi/hass_parse_req_error

home-assistant: Add error output for missing deps
This commit is contained in:
Jörg Thalheim 2020-01-09 11:07:55 +00:00 committed by GitHub
commit db4cdd05cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')