Poetry 1.1.x breaks mypy in a project with source dependencies
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: MacOS 10.16.5
- Poetry version: 1.1.1
- Link of a Gist with the contents of your pyproject.toml file: link
Issue
This is an issue with mypy under .venv
created with latest Poetry (v1.1.x) which works just fine if the .venv
was created with older version (v1.0.10 or before)
Our project has two source dependencies on other internal projects.
After the upgrade (and re-creating the .venv
) running poetry run mypy .
produces a whole bunch of errors like:
error: Cannot find implementation or library stub for module named 'our_source_project1.something'
error: Cannot find implementation or library stub for module named 'our_source_project2.something_else'
Digging through the logs, diffs and then mypy source code I narrowed it down to this:
Under Poetry v1.0 a .venv/lib/python3.8/site-packages/easy-install.pth
file gets created which contains paths to each of our code dependency projects.
Under Poetry v1.1 this file doesn’t get created.
Thing is, mypy reads this specific file to find these source dependencies. (source). Without it it doesn’t know how to find them, hence the errors, and a broken build.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:20 (10 by maintainers)
I just found this issue today when I started running into the problem. Looks like MyPy v.0.800 was released today, 22 Jan 2021. I’m getting this error with the new 0.800 version.
Fair call @abn . Now 🤞 mypy 0.800 gets released soon so I can upgrade :partyparrot: