replace import lhs with import_module(lhs)

This commit is contained in:
navjot 2020-11-24 21:25:09 +05:30
parent a7e213af41
commit dd3511eaa5
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C

View File

@ -153,18 +153,25 @@ for lhs, rhs in EXTRAS_REQUIRE.items():
if x in EXTRAS_REQUIRE_DEPS if x in EXTRAS_REQUIRE_DEPS
]): ]):
print('lhs, rhs : ', lhs, rhs) print('lhs, rhs : ', lhs, rhs)
print('CMD: ', CMD) # print('CMD: ', CMD)
print('[[OPSYS]]: ', ' '.join([''. join([xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS]])for x in rhs if x in EXTRAS_REQUIRE_DEPS])) # print('[xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS]]: ', [xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS]])
# print('[]: ', [for x in rhs if x in EXTRAS_REQUIRE_DEPS]) # print('[]: ', [for x in rhs if x in EXTRAS_REQUIRE_DEPS])
try: try:
import lhs import_module(lhs)
print('Try pass <<<<<<<<<<<<<Sucess>>>>>>>>>>>>>>>>') print('Try pass <<<<<<<<<<<<<Sucess>>>>>>>>>>>>>>>>')
except Exception as e: except Exception as e:
print('Except <<<<<<<<<<<<<<Fail>>>>>>>>>>>>>>>>>>>') print('Except <<<<<<<<<<<<<<Fail>>>>>>>>>>>>>>>>>>>')
rhs_cmd = ''.join([ rhs_cmd = ''.join([
CMD, CMD,
' ', ' ',
' '.join([''. join([xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS]])for x in rhs if x in EXTRAS_REQUIRE_DEPS]),]) ' '.join([
''. join([
xx for xx in EXTRAS_REQUIRE_DEPS[x][OPSYS]
])
for x in rhs
if x in EXTRAS_REQUIRE_DEPS
]),
])
print('MMMMMMM: ', lhs, rhs_cmd) print('MMMMMMM: ', lhs, rhs_cmd)
print( print(
"Optional dependency `pip install .[{}]` would require `{}`" "Optional dependency `pip install .[{}]` would require `{}`"