cool-easter-32542
06/28/2024, 12:10 PMextra_type_stubs behaviour in new pants, since the solution involves adding the stubs to the sources' dependencies.
Pants version
2.21, but this behaviour is also present in at least 2.20.
Additional info
I have a repo that reproduces this problem: https://github.com/gcbirzan-plutoflume/pants-test
When I run check:
$ pants check ::
15:03:08.37 [WARN] No `/Users/cbirzan/PycharmProjects/pants-test/.python-version` found in the build root, but <PYENV_LOCAL> was set in `[python-bootstrap].search_path`.
15:03:09.35 [INFO] Completed: Building 1 requirement for requirements.pex from the test.lock resolve: requests==2.32.2
15:03:10.31 [INFO] Completed: Building 2 requirements for mypy.pex from the pants-mypy.lockfile resolve: mypy==1.5.1, types-requests==2.32.0.20240622
15:03:11.44 [INFO] Completed: Building requirements_venv.pex
15:03:13.91 [ERROR] Completed: Typecheck using MyPy - mypy - mypy failed (exit code 1).
foo.py:1: error: Library stubs not installed for "requests" [import]
foo.py:1: note: Hint: "python3 -m pip install types-requests"
foo.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
foo.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)
ā mypy failed.
pantsbuild/pants