Repository navigation
Expand file tree
/
Copy pathBUILD.bazel
More file actions
66 lines (56 loc) · 2.08 KB
/
Copy pathBUILD.bazel
File metadata and controls
66 lines (56 loc) · 2.08 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"""Platform daemon wheels, their installed runtime layers and provenance."""
load("@rules_python//python:py_binary.bzl", "py_binary")
load("@sonic_build_infra//python:source_package.bzl", "python_runtime_packages")
load(":bazel/daemons.bzl", "DAEMONS", "daemon_distribution")
py_binary(
name = "wheel_builder",
srcs = ["bazel/build_wheel.py"],
main = "bazel/build_wheel.py",
python_version = "3.13",
deps = [
"@platform_daemons_build_pip//pytest_runner",
"@platform_daemons_build_pip//setuptools",
"@platform_daemons_build_pip//wheel",
],
)
py_binary(
name = "ycable_protoc",
main_module = "grpc_tools.protoc",
python_version = "3.13",
deps = ["@platform_daemons_build_pip//grpcio_tools"],
)
genrule(
name = "ycabled_proto",
srcs = ["sonic-ycabled/proto/proto_out/linkmgr_grpc_driver.proto"],
outs = ["proto_out/linkmgr_grpc_driver_pb2.py", "proto_out/linkmgr_grpc_driver_pb2_grpc.py"],
tools = [":ycable_protoc"],
cmd = """
source=$(location sonic-ycabled/proto/proto_out/linkmgr_grpc_driver.proto)
include=$${source%/proto_out/*}
$(execpath :ycable_protoc) -I"$$include" --python_out=$(RULEDIR) --grpc_python_out=$(RULEDIR) "$$source"
""",
visibility = ["//visibility:public"],
)
[daemon_distribution(name) for name in DAEMONS]
filegroup(
name = "daemons.wheels",
srcs = [name + ".wheel" for name in DAEMONS],
visibility = ["//visibility:public"],
)
python_runtime_packages(
name = "daemons.runtime",
deps = [name + ".runtime" for name in DAEMONS],
visibility = ["//visibility:public"],
)
filegroup(
name = "daemons.runtime_metadata",
srcs = [":daemons.runtime"],
output_group = "metadata",
visibility = ["//visibility:public"],
)
filegroup(
name = "test_sources",
srcs = glob(["sonic-*/**/*.py", "sonic-*/scripts/*", "sonic-*/tests/**", "sonic-*/pytest.ini", "sonic-*/setup.cfg"], exclude = ["**/*.pyc", "**/__pycache__/**"]),
visibility = ["//visibility:public"],
)
exports_files(glob(["sonic-*/setup.py"]) + ["bazel/requirements-codegen-lock.txt"])