From dd3511eaa5b6b6e6af0544fee8264507956c8f56 Mon Sep 17 00:00:00 2001 From: navjot Date: Tue, 24 Nov 2020 21:25:09 +0530 Subject: [PATCH] replace import lhs with import_module(lhs) --- checkdeps.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/checkdeps.py b/checkdeps.py index 35b15608..190d3496 100755 --- a/checkdeps.py +++ b/checkdeps.py @@ -153,18 +153,25 @@ for lhs, rhs in EXTRAS_REQUIRE.items(): if x in EXTRAS_REQUIRE_DEPS ]): print('lhs, rhs : ', lhs, rhs) - 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('CMD: ', CMD) + # 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]) try: - import lhs + import_module(lhs) print('Try pass <<<<<<<<<<<<>>>>>>>>>>>>>>>') except Exception as e: print('Except <<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>') rhs_cmd = ''.join([ 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( "Optional dependency `pip install .[{}]` would require `{}`"