load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")

oncall("executorch")

# Use runtime.python_library instead of the one defined in python_library.bzl,
# so we can have access to EXECUTORCH_CLIENTS list.
fbcode_target(_kind = runtime.python_library,
    name = "lib",
    srcs = [
        "__init__.py",
    ] + glob(["generated/**/*.py"]),
    resources = {
        "//executorch/devtools/bundled_program/schema:bundled_program_schema.fbs": "bundled_program_schema.fbs",
        "//executorch/devtools/bundled_program/schema:scalar_type.fbs": "scalar_type.fbs",
    },
    # Currently serialization API should only be used in some dedicated targets,
    # to avoid ODR violation when linking with another Flatbuffers library.
    # Please ask before changing this.
    visibility = ["PUBLIC"],
    deps = [
        "fbsource//third-party/pypi/flatbuffers:flatbuffers",
        "fbsource//third-party/pypi/setuptools:setuptools",
        "//executorch/devtools/bundled_program/schema:bundled_program_schema_py",
        "//executorch/exir/_serialize:lib",
    ],
)
