load("@rules_python//python:defs.bzl", "py_binary")
load("@py_deps//:requirements.bzl", "requirement")
load(":binary.bzl", "pip_binary")

# e.g. bazel run python
alias(
    name = "python",
    actual = "@python//:python",
)

# e.g. bazel run python:pip
pip_binary(name = "pip")

pip_binary(name = "black")

pip_binary(name = "isort")

pip_binary(name = "mypy")

pip_binary(
    name = "dmypy",
    pkg = "mypy",
)

pip_binary(name = "pylint")

pip_binary(
    name = "protoc-gen-mypy",
    pkg = "mypy-protobuf",
)

py_binary(
    name = "update",
    srcs = ["update.py"],
    data = [
        "requirements.in",
        "requirements.txt",
    ],
    tags = ["manual"],
    deps = [
        requirement("pip-tools"),
    ],
)

exports_files([
    "requirements.txt",
    "licenses.json",
])
