question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
andrewtemmecommented, Jan 22, 2021

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.

2reactions
kkozmiccommented, Oct 13, 2020

Fair call @abn . Now 🤞 mypy 0.800 gets released soon so I can upgrade :partyparrot:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency Management With Python Poetry
A dependency manager like Python Poetry helps you specify, install, and resolve external packages in your projects.
Read more >
My Python Project Setup - SRCco.de
My setup for Python projects includes: Python 3.7+; Poetry for dependency management; Make to leverage muscle memory; black for code formatting ...
Read more >
Third-party dependencies - Pants build
For Pants to know which dependencies each file uses, it must first know which specific dependencies are in your "universe", i.e. all the...
Read more >
Package List — Spack 0.20.0.dev0 documentation
Designed for programmers with large heterogeneous trees of source code, ack is written purely ... Versions: develop, 1.2, 1.1, 1.0; Build Dependencies: mpi ......
Read more >
tox-poetry-installer - Python Package Health Analysis - Snyk
A plugin for Tox that lets you install test environment dependencies from the ... Snyk scans all the packages in your projects for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found