zmoog / public-notes

Apache License 2.0
0 stars 1 forks source link

Add type hints to an existing Python project #11

Open zmoog opened 1 year ago

zmoog commented 1 year ago

I installed mypy, but it is throwing this error due to type missing type hints in lxml:

$ make ready
black --diff --check --line-length=79 axios tests
All done! ✨ 🍰 ✨
6 files would be left unchanged.
isort --diff --check --line-length=79 --py 39 --profile black axios tests
mypy axios tests
axios/navigator.py:5: error: Skipping analyzing "lxml": module is installed, but missing library stubs or py.typed marker  [import]
axios/navigator.py:5: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
axios/cli.py:85: error: "IO[str]" has no attribute "getvalue"  [attr-defined]
Found 2 errors in 2 files (checked 6 source files)
make: *** [type-check] Error 1
zmoog commented 1 year ago

After reading https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports I learned there's a types-lxml package available. Adding it to the dev dependencies.