Skip to content
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

astroid cannot import modules from wheels #541

Closed
leifwalsh opened this issue Apr 27, 2018 · 1 comment
Closed

astroid cannot import modules from wheels #541

leifwalsh opened this issue Apr 27, 2018 · 1 comment
Labels
Bug 🪳 Good first issue Friendly and approachable by new contributors

Comments

@leifwalsh
Copy link

leifwalsh commented Apr 27, 2018

Steps to reproduce

  1. Have a .whl file on the path, and code that imports it
  2. Run pylint on the importing code

Current behavior

pylint reports an error that it cannot import the module

Expected behavior

pylint doesn't report an error

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

astroid 1.6.3, pylint 1.8.1

I believe the fix would be to add '.whl' to this list: https://github.com/PyCQA/astroid/blob/e0a298df55b15abcb77c2a93253f5ab7be52d0fb/astroid/manager.py#L188

I've patched astroid locally and this does allow astroid to import the module. I'm surprised we haven't seen this before, I think an older version of pylint also failed to astroid-import the module, but just didn't complain about it?

@PCManticore
Copy link
Contributor

Hey @leifwalsh Thanks for creating the issue! Yes that fix might actually solve this problem and sounds reasonable. Would you mind sending a PR with that?

@AWhetter AWhetter added the Good first issue Friendly and approachable by new contributors label May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪳 Good first issue Friendly and approachable by new contributors
Projects
None yet
Development

No branches or pull requests

3 participants