bazel-mypy-integration icon indicating copy to clipboard operation
bazel-mypy-integration copied to clipboard

mypy can't find rule_python requirements

Open WeiYunKolmostar opened this issue 2 years ago β€’ 1 comments

Hi, I recently meet a problem when using bazel-mypy-integration and I wonder if you have a way to solve it. I use rule_python to control pip dependencies, but when running mypy check like

bazel build  --aspects @mypy_integration//:mypy.bzl%mypy_aspect --output_groups=mypy //test:test_mypy_with_numpy

with the BUILD file

load("@py_deps//:requirements.bzl", "requirement")

py_library(
    name = 'test_mypy_with_numpy',
    srcs = [test_mypy_with_numpy.py'],
    deps = [
        requirement('numpy'),
    ]

I found numpy related code wasn't checked. But when I use pip install numpy, it will be checked. So is there any way to let mypy_integration use requirement from rule_python ?

WeiYunKolmostar avatar Sep 19 '22 08:09 WeiYunKolmostar

I have added support for PEP-561 stub packages in a separate project as mentioned in this thread: https://github.com/bazel-contrib/bazel-mypy-integration/issues/39

alexmirrington avatar Sep 17 '23 14:09 alexmirrington