implemented dependency checks in checkdeps module

This commit is contained in:
navjot 2020-11-25 19:52:27 +05:30
parent 9265235053
commit d2a340d012
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C

View File

@ -144,20 +144,23 @@ for lhs, rhs in EXTRAS_REQUIRE.items():
for x in rhs for x in rhs
if x in EXTRAS_REQUIRE_DEPS if x in EXTRAS_REQUIRE_DEPS
]): ]):
rhs_cmd = ''.join([ try:
CMD, import_module(lhs)
' ', except Exception as e:
' '.join([ rhs_cmd = ''.join([
''. join([ CMD,
xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS] ' ',
]) ' '.join([
for x in rhs ''. join([
if x in EXTRAS_REQUIRE_DEPS xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS]
]), ])
]) for x in rhs
print( if x in EXTRAS_REQUIRE_DEPS
"Optional dependency `pip install .[{}]` would require `{}`" ]),
" to be run as root".format(lhs, rhs_cmd)) ])
print(
"Optional dependency `pip install .[{}]` would require `{}`"
" to be run as root".format(lhs, rhs_cmd))
if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER: if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER:
print("You can install the missing dependencies by running, as root:") print("You can install the missing dependencies by running, as root:")