9d853bbb03
- anki._backend stores the protobuf files and rsbackend.py code - pylib modules import protobuf messages directly from the _pb2 files, and explicitly export any will be returned or consumed by public pylib functions, so that calling code can import from pylib - the "rsbackend" no longer imports and re-exports protobuf messages - pylib can just consume them directly. - move errors to errors.py Still todo: - rsbridge - finishing the work on rsbackend, and check what we need to add back to the original file location to avoid breaking add-ons
54 lines
1.1 KiB
Python
54 lines
1.1 KiB
Python
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
|
|
load("@py_deps//:requirements.bzl", "requirement")
|
|
|
|
py_binary(
|
|
name = "mypy_protobuf",
|
|
srcs = [requirement("mypy-protobuf").replace(":pkg", ":mypy_protobuf.py")],
|
|
visibility = [
|
|
"//visibility:public",
|
|
],
|
|
deps = [requirement("mypy-protobuf")],
|
|
)
|
|
|
|
py_binary(
|
|
name = "protoc_wrapper",
|
|
srcs = ["protoc_wrapper.py"],
|
|
visibility = [
|
|
"//visibility:public",
|
|
],
|
|
deps = [
|
|
":mypy_protobuf",
|
|
"@rules_python//python/runfiles",
|
|
],
|
|
)
|
|
|
|
py_library(
|
|
name = "hookslib",
|
|
srcs = ["hookslib.py"],
|
|
imports = ["."],
|
|
visibility = [
|
|
"//pylib:__subpackages__",
|
|
"//qt:__pkg__",
|
|
],
|
|
)
|
|
|
|
py_binary(
|
|
name = "genhooks",
|
|
srcs = [
|
|
"genhooks.py",
|
|
"hookslib.py",
|
|
],
|
|
imports = ["."],
|
|
visibility = ["//pylib:__subpackages__"],
|
|
deps = [
|
|
requirement("black"),
|
|
requirement("stringcase"),
|
|
],
|
|
)
|
|
|
|
filegroup(
|
|
name = "py_source_files",
|
|
srcs = glob(["*.py"]),
|
|
visibility = ["//pylib:__subpackages__"],
|
|
)
|