-
Notifications
You must be signed in to change notification settings - Fork 13
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
mypy doesn't find stubs when on PYTHONPATH #25
Comments
Looks like this issue goes back to 2013 (python/mypy#175). |
Yeah, the plugin doesn't do anything special about module lookups (and probably shouldn't do). Instead of setting PYTHONPATH, you can try setting |
Adding
Omitting PYTHONPATH altogether as suggested only results in the plugin failing to load:
|
I even tried using an absolute path to |
I also tried setting |
Hm, I'm not sure what's your problem now. Stubs for |
I'm not trying to provide stubs, only trying to consume them from mypy-zope when mypy-zope is not installed in system-site-packages (only available on sys.path). I'm pretty sure it's an upstream issue with mypy itself failing to load stubs that aren't on some blessed path. I'm trying to include the stubs because the mypy checks fail without the stubs. Maybe I don't understand the question. |
Is there a simple way for me to repro the issue? |
Would you like a Dockerfile that implements the repro in the OP? |
That would work |
Here's the Dockerfile:
If you use
That's xonsh syntax, but assuming you're using a bash-like shell, you can probably do:
The docker example doesn't use any virtualenvs but just installs everything (except mypy-zope) in the system site-packages. You should be able to |
Oh, I see. I'll try to play with it tomorrow. |
So, a bit later than I would've liked, but I did look into this. Apparently mypy only looks for stub dirs in site-packages dir, i.e. ones that are returned by If you want to dig deeper, the third parameter to |
Probably an upstream issue, but first encountered here, so reporting the details. Running a check on a file importing
zope.interface
will result in an error "Skipping analyzing zope.interface".Even though the stubs are there:
Installing the plugin directly into the virtualenv seems to work fine.
The text was updated successfully, but these errors were encountered: