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

Type hint support broken: missing py.typed #106

Closed
feuGeneA opened this issue Oct 22, 2018 · 0 comments · Fixed by #107
Closed

Type hint support broken: missing py.typed #106

feuGeneA opened this issue Oct 22, 2018 · 0 comments · Fixed by #107

Comments

@feuGeneA
Copy link

feuGeneA commented Oct 22, 2018

image

  • Version: 1.2.0
  • Python: 3.7
  • OS: linux

What was wrong?

I have a package which uses eth_abi, and which lints its code with mypy. Telling mypy to ignore the eth_abi import (import ... # type: ignore) obviously works fine, but when I remove that ignore, I get the following message:

test.py:13: error: Cannot find module named 'eth_abi'
test.py:13: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help)

The line in question is simply:

from eth_abi import encode_abi

How can it be fixed?

Per PEP 484, include a file py.typed in the package. In my local environment, I was able to solve the problem by simply doing touch ~/.pythonz/lib/python3.7/site-packages/eth_abi-1.2.0-py3.7.egg/eth_abi/py.typed.

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

Successfully merging a pull request may close this issue.

1 participant