numerous-xylophone-26710
05/06/2023, 12:16 AMpants check ::
. I've reproduced the error in a minimal setup.
Basically, I have one file which imports a third-party dep and a mypy_stub to include types for that 3rd party dep.
# ./modules/validator.py
from email_validator import EmailNotValidError, validate_email
# ./mypy_stubs/email_validator/__init__.pyi
... contains some typing info ...
pipenv run mypy
runs successfully on these files. However, ./pants check ::
will give me this error:
modules/validator.py:1: error: Skipping analyzing "email_validator": module is installed, but missing library stubs or py.typed marker
My setup also exists here in this repo: https://github.com/chrisplim/pants-check-error-mypy-stubbroad-processor-92400
05/07/2023, 5:18 AMBUILD
file and python_sources()
target.broad-processor-92400
05/07/2023, 5:22 AM[tailor]
section entirely (including its ignore_paths
setting) from pants.toml
, and then ran ./pants tailor ::
. This generated a BUILD
file along the lines of the previous comment. And then ./pants check ::
ran successfully ✅
So: I think this is fixed by making sure pants is told about any type stubs via python_sources()
targets.
Does that work for you?happy-kitchen-89482
05/07/2023, 6:27 AMhappy-kitchen-89482
05/07/2023, 6:27 AMnumerous-xylophone-26710
05/08/2023, 3:41 PM