aboutsummaryrefslogtreecommitdiff
path: root/tools/interface_generator/private/defs.bzl
blob: 8e2ae8df959aeb24476f1db676a4a5b7d6e252ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
    )