-
Notifications
You must be signed in to change notification settings - Fork 145
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
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses #334
Comments
It was not removed, Python 3 still ships a load_source in imp.py: Luckily the _LoadSourceCompatibility hack is not needed for us, we could use importlib.machinery.SourceFileLoader(name, pathname) directly, since we don't pass the The use of importlib._bootstrap._load() unnerves me, I'd prefer to avoid calling private methods. I'm sure importlib has a way of loading Python source files from a specific directory on disk without adding that directory to sys.path, without using private methods. |
Surprise, surprise, this code is not covered by tests. |
why do we need this at all? this code looks super weird to me... we do permission checks, then why do we have our own plugin system? in my feed2exec project, i do have a very rudimentary plugin system, but it relies exclusively on Python's packages, nothing special regarding magic directories, search paths or permissions. it just does I'm not especially proud of this, but it is much simpler. I also realized I didn't need to have "discovery" like we're doing in linkchecker, and I'm not sure why we're doing that in the first place... maybe the GUI needs to be able to list plugins that can be enabled? who knows... Before embarking in this for feed2exec, I did do a quick tour of other plugin systems. If we do need more elaborate capabilities than just I'd probably lean towards whatever PyPA is doing. And of course I wouldn't object to fixing our code either, but I just thought I'd bring up the fundamental design issue here, which is that we have a lot of legacy code in linkchecker, and any time we can flush some of it (like python 2, a custom HTML parser or network engine!) in favor of an existing external package that looks sane, we should. :) |
Updated to use importlib in #478. The code changed is only supporting an undocumented feature of installing user plugins in |
Summary
If you run
tox -e py37
, one of the things you see isThere's only one use of
imp
: inlinkcheck/loader.py
'sget_folder_modules()
:load_source is documented for Python 2.7, but not for Python 3.5 through 3.8. Was it removed? Who knows.
The text was updated successfully, but these errors were encountered: