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

Missing types #17

Open
midlik opened this issue Jan 30, 2024 · 1 comment
Open

Missing types #17

midlik opened this issue Jan 30, 2024 · 1 comment

Comments

@midlik
Copy link
Collaborator

midlik commented Jan 30, 2024

Hi, I'm creating example for using the molviewspec Python package. All works fine and I'm getting correct code suggestions and types in IDE. But when I run mypy, it says types for molviewspec are missing.

@JonStargaryen could you have a look at this?

$ cat example.py 
import molviewspec as mvs
builder = mvs.create_builder()

$ python -m mypy example.py 
example.py:1: error: Skipping analyzing "molviewspec": module is installed, but missing library stubs or py.typed marker  [import-untyped]
example.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

$ python -m pip freeze
molviewspec==0.1.3
mypy==1.8.0
mypy-extensions==1.0.0
pydantic==1.10.14
typing_extensions==4.9.0
@sbittrich
Copy link
Member

By no means a fix but python -m mypy --ignore-missing-imports example.py deals with this.

From what I saw, py.typed should be part of the project if it's typed. It can be empty if types are part of the codebase, as is the case here. Anyway, this isn't good enough to get rid of the error but certainly good to have regardless. Might do some more digging if I find the time. Not sure how big of an issue this is. It happens for dependencies as well, which is the reason for ignore_missing_imports = True in our mypy.ini.

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

No branches or pull requests

2 participants