-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partially remove dependency on imp. #686
Conversation
Note that removing the final dependency on imp requires making a decision. It is located in I see 2 options for how to solve this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImpFinder is """A finder based on the imp module.""" so importlib
-related stuff should probably go into separate class.
module_type=_imp_type_to_module_type(mp_desc[2]), | ||
else: | ||
try: | ||
loader = importlib.util.find_spec(modname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious. The function returns ModuleSpec
object, why did you name it loader
?
Don't know if it would help, but here is ref to similar improvement in pytest-dev/pytest#5468 |
This is on my todo list for reviewing. Unfortunately might take me a bit as I'll be in vacation for the next two weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @degustaf Thank you for the PR and sorry for this extreme delay! This all looks good to me, and option 1 sounds the best, since it does not seem that we rely on use_sys
neither here, nor in pylint
, so I'd say we should go with that.
pass | ||
submodule_path = sys.path | ||
|
||
suffixes = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to build this list globally instead of building it every time this function is called?
@degustaf Can you rebase your PR when you get a chance? I'd like to pull this in. Thank you! |
@PCManticore I should be able to do that tonight. |
any hope on this ? I see some packages have made the transition like ansible/ansible#54883 |
https://build.opensuse.org/request/show/816653 by user mcepl + dimstar_suse - Add part_rm_dep_imp.patch to replace missing `imp` package (gh#pylint-dev/astroid#686).
I close this issue because #857 has been merged. |
Steps
Description
This partially removes the dependency on the deprecated imp module.
Type of Changes
Related Issue
This is related to issues #594 and #681