<#21114 mypy dependencies are not used when runnin...
# github-notifications
c
#21114 mypy dependencies are not used when running the check goal Issue created by gcbirzan-plutoflume Describe the bug The documentation says that including type stubs in the mypy custom lockfile will cause them to be used when running check, but that's not true. This means that there's no way to emulate the
extra_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:
Copy code
$ 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