load("//devtools/python/blaze:pytype.bzl", "pytype_strict_binary", "pytype_strict_library")
load("//third_party/py/etils:build_defs.bzl", "glob_py_srcs")

package(
    default_applicable_licenses = ["//third_party/py/cloud_goodput:license"],
    default_visibility = ["//visibility:private"],
    licenses = ["notice"],
)

pytype_strict_library(
    name = "cloud_goodput",
    # Returns all non-test python files recursively
    srcs = glob_py_srcs(),
    visibility = ["//visibility:public"],
    # Project dependencies (matching the `pip install` deps defined in `pyproject.toml`)
    deps = [
        "//third_party/py/google/api_core",
        "//third_party/py/google/cloud/logging",
        "//third_party/py/google/cloud/monitoring_v3",
        "//third_party/py/numpy",
        "//third_party/py/requests",
        "//third_party/py/scipy",
        "//third_party/py/tensorboardX",
        "//third_party/py/urllib3",
    ],
)

pytype_strict_binary(
    name = "goodput",
    srcs = [
        "checkpoint_badput_calculator.py",
        "goodput.py",
        "monitoring.py",
    ],
    deps = [
        ":cloud_goodput",
        "//third_party/py/google/cloud/logging",
        "//third_party/py/numpy",
        "//third_party/py/scipy",
        "//third_party/py/tensorboardX",
    ],
)
