Skip to content

Trouble with Poetry and mypy plugin #11

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

Closed
sbdchd opened this issue Jan 26, 2019 · 2 comments
Closed

Trouble with Poetry and mypy plugin #11

sbdchd opened this issue Jan 26, 2019 · 2 comments

Comments

@sbdchd
Copy link

sbdchd commented Jan 26, 2019

I've been having issues with poetry https://github.com/sdispater/poetry and getting the mypy plugin to work.

Here is my setup:

❯ poetry --version
Poetry 0.11.0

pyproject.toml

[tool.poetry]
name = "tmp.2kfpjvxv"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "*"
django = "^2.1"

[tool.poetry.dev-dependencies]
mypy = "^0.660.0"
django-stubs = "^0.2.0"

mypy.ini

[mypy]
python_version=3.6
show_column_numbers=True
warn_incomplete_stub = True
warn_redundant_casts = True
warn_unused_configs = True
scripts_are_modules = True
incremental = True
ignore_missing_imports = True
check_untyped_defs = True
warn_no_return = True
warn_return_any = True
warn_unused_ignores = True
no_implicit_optional = True
plugins =
    mypy_django_plugin.main

And running mypy gives the following error:

poetry run mypy --config-file mypy.ini src

mypy.ini:15:1: error: Error importing plugin 'mypy_django_plugin.main'

Note: the django stubs works, the only issue is with the plugin

Here are the site-packages in .venv

Django-2.1.5.dist-info/
__pycache__/
_ast27.cpython-36m-darwin.so*
_ast3.cpython-36m-darwin.so*
django/
django-stubs/
django_stubs-0.2.0.dist-info/
easy_install.py
mypy/
mypy-0.660.dist-info/
mypy_django_plugin/
mypy_extensions-0.4.1.dist-info/
mypy_extensions.py
pip/
pip-9.0.3.dist-info/
pkg_resources/
pytz/
pytz-2018.9.dist-info/
setuptools/
setuptools-39.0.1.dist-info/
typed_ast/
typed_ast-1.2.0.dist-info/
@emmatyping
Copy link
Contributor

I was unable to reproduce this. Perhaps try removing the line break from the config file?

@sbdchd
Copy link
Author

sbdchd commented Feb 12, 2019

Seems that either later latest django-stubs or poetry fix this issue.

@sbdchd sbdchd closed this as completed Feb 12, 2019
@TonyRippy TonyRippy mentioned this issue Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants