Closed tsoernes closed 5 years ago
Does the package have a py.typed
file in it as PEP 561 specifies?
@ethanhs I created two blank files py.typed
, one in RSSPull
(top level directory, i.e. same level as setup.py
and one in RSSPull/rsspull
(same level as the source code)..
Mypy is still unable to import the rsspull
module.
I don't think this should matter, but does the setup.py
have a zip_safe=False
?
Also could you try running python -m mypy.sitepkgs
?
@ethanhs No to the former.
['/home/torstein/anaconda3/envs/rss/lib/python3.7/site-packages', '/home/torstein/.local/lib/python3.7/site-packages']
@tsoernes if you add zip_safe=False
to your package, does it work? I can't remember, but I think that may fix it.
See the documentation too https://mypy.readthedocs.io/en/latest/installed_packages.html#making-pep-561-compatible-packages
It certainly does! Thanks a lot.
Great! Glad that worked. Maybe we should have a common issues section related to PEP 561 packages not working...
I have a module installed as editable by pip, i.e.
pip install -e ..
. Mypy cannot import it, even when run aspython -m mypy
:~/.config/mypy/config
:Installing a module as editable creates an egg link in the virtual env, whatever that is:
(I'm running mypy inside of the anaconda virtual env. Python is able to find the module)