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

stubs for plugin not found when plugin on PYTHONPATH #9678

Closed
jaraco opened this issue Oct 31, 2020 · 2 comments
Closed

stubs for plugin not found when plugin on PYTHONPATH #9678

jaraco opened this issue Oct 31, 2020 · 2 comments
Labels
bug mypy got something wrong

Comments

@jaraco
Copy link
Member

jaraco commented Oct 31, 2020

Bug Report

In Shoobx/mypy-zope#25, I describe an issue where installing the plugin into a path on PYTHONPATH (but not in site-packages) causes the stubs not to be present, causing failures on a simple check that would otherwise pass. This behavior means that any libraries with stubs cannot be used with tools like pip-run.

To Reproduce

  1. Install pip-run. Then:
$ cat > mypy.ini
[mypy]
plugins=mypy_zope:plugin
$ cat > interface.py
from zope.interface.interface import Interface

   
class X(Interface):
    pass
$ pip-run -q --use-pep517 mypy-zope -- -m mypy interface.py
interface.py:1: error: Cannot find implementation or library stub for module named 'zope.interface.interface'
interface.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

See the downstream report for a repro not using pip-run.

Expected Behavior

A plugin should be able to expose stubs by being installed. Is there something the plugin could be doing to avoid this undesirable behavior?

Actual Behavior

Stubs are missing leading to spurious errors.

Your Environment

  • Mypy version used: 0.790
  • Mypy command-line flags: see above
  • Mypy configuration options from mypy.ini (and other config files): see above
  • Python version used: 3.9.0
  • Operating system and version: macOS 10.15
@jaraco jaraco added the bug mypy got something wrong label Oct 31, 2020
@isac322
Copy link

isac322 commented Dec 14, 2020

Same on Linux too!

@emmatyping
Copy link
Collaborator

Hi, this seems to be a duplicate of #5701 so closing in favor of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants