Use pkgutil.iter_modules to get un-imported module for test_pre_import#1085
Conversation
|
Wonder if we can do this with Note that there is a backport package |
pentschev
left a comment
There was a problem hiding this comment.
I think you are right indeed @charlesbluca , good catch and thanks for the investigation/fixing work! 😄
|
/merge |
|
Converted to draft to try out @jakirkham's suggestion of using |
|
After doing some digging into >>> importlib_metadata.packages_distributions()
{'... 'docker': ['ucx-py'], ...}
>>> import docker
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'docker'Since this issue is blocking CI at the moment, and my local testing of |
|
/merge |
Changed this because IIUC
pkg_resources.working_setis listing the installed distributions and not necessarily the importable modules; this becomes an issue if the distribution and module names aren't the same (e.g. one wouldconda install pillowand thenimport PIL), which was causing some failures in CI that seem unrelated to the changes here.Originally posted by @charlesbluca in #981 (comment)