load("@pip//:requirements.bzl", "requirement") def py_pytest(name, srcs, deps = [], data = [], **kwargs): native.py_test( name = name, srcs = ["//private:pytest_wrapper.py"], main = "//private:pytest_wrapper.py", legacy_create_init = False, imports = ["."], args = [ "--capture=no", "--black", "--pylint", "--pylint-rcfile=$(location //private:pylintrc)", "--mypy", "--mypy-config-file=$(location //private:mypyrc)", ] + ["$(location :%s)" % x for x in srcs], deps = [ requirement("pytest"), requirement("pytest-black"), requirement("pytest-pylint"), requirement("pytest-mypy"), ] + deps, data = [ "//private:mypyrc", "//private:pylintrc", ] + srcs + data, **kwargs )