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

Two-line file, both ignored, leads to errors within mypy-django. Errors disappear if one line removed, get worse if the other. #11

Open
mwchase opened this issue Sep 22, 2017 · 0 comments

Comments

@mwchase
Copy link

mwchase commented Sep 22, 2017

Encountered against the latest checkouts, with mypy==0.521

Two lines:

from django.views import View # type: ignore
from django.db import models  # type: ignore

Errors:

$ MYPYPATH=mypy-django mypy --strict-optional --disallow-untyped-calls test_mypy.py 
mypy-django/django/views/generic/list.pyi:3: error: No library stub file for module 'django.db.models'
mypy-django/django/views/generic/list.pyi:3: note: (Stub files are from https://github.com/python/typeshed)
mypy-django/django/views/generic/list.pyi:4: error: No library stub file for module 'django.db.models.query'

One line:

from django.views import View # type: ignore

Errors:

$ MYPYPATH=mypy-django mypy --strict-optional --disallow-untyped-calls test_mypy.py 
mypy-django/django/views/generic/dates.pyi:4: error: No library stub file for module 'django.db'
mypy-django/django/views/generic/dates.pyi:4: note: (Stub files are from https://github.com/python/typeshed)
mypy-django/django/views/generic/detail.pyi:3: error: No library stub file for module 'django.db'
mypy-django/django/views/generic/edit.pyi:3: error: No library stub file for module 'django.db'
mypy-django/django/views/generic/list.pyi:3: error: No library stub file for module 'django.db.models'
mypy-django/django/views/generic/list.pyi:4: error: No library stub file for module 'django.db.models.query'

This is stripped down from a more reasonably-sized file that actually did things, but it seems to be the imports themselves that triggered the issues.

I think this must be some kind of import-order issue.

(I forget why I was ignoring both lines, but it doesn't seem to really have a tangible effect on the output.)

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

No branches or pull requests

1 participant