Replace rules_pip with rules_python; use bazel built upstream grpc
instead of Python packages
As usual with Python sadness, the @pydeps wheels are built on the bazel
host, so stuffing them inside a container_image (or py_image) will cause
new and unexpected kinds of misery.
Change-Id: Id4e4d53741cf2da367f01aa15c21c133c5cf0dba
diff --git a/bgpwtf/cccampix/BUILD b/bgpwtf/cccampix/BUILD
index a96f739..205289f 100644
--- a/bgpwtf/cccampix/BUILD
+++ b/bgpwtf/cccampix/BUILD
@@ -1,5 +1,6 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
load("@subpar//:subpar.bzl", "par_binary")
+load("@pydeps//:requirements.bzl", "requirement")
par_binary(
name = "ripe-sync",
@@ -7,9 +8,9 @@
"ripe-sync.py",
],
deps = [
- "@pydeps//grpcio",
- "@pydeps//requests",
+ requirement("requests"),
"//bgpwtf/cccampix/proto:ix_py_proto",
+ "//bgpwtf/cccampix/proto:ix_grpc_proto",
],
legacy_create_init = False,
zip_safe = False,
diff --git a/bgpwtf/cccampix/frontend/BUILD.bazel b/bgpwtf/cccampix/frontend/BUILD.bazel
index 6fae1d3..f9bbd90 100644
--- a/bgpwtf/cccampix/frontend/BUILD.bazel
+++ b/bgpwtf/cccampix/frontend/BUILD.bazel
@@ -1,4 +1,5 @@
load("@subpar//:subpar.bzl", "par_binary")
+load("@pydeps//:requirements.bzl", "requirement")
py_library(
name = "frontend_lib",
@@ -10,10 +11,12 @@
"templates/**",
]),
deps = [
- "@pydeps//arrow",
- "@pydeps//flask",
- "@pydeps//grpcio",
+ requirement("arrow"),
+ requirement("flask"),
+ requirement("werkzeug"),
+ requirement("itsdangerous"),
"//bgpwtf/cccampix/proto:ix_py_proto",
+ "//bgpwtf/cccampix/proto:ix_grpc_proto",
],
)
@@ -36,13 +39,14 @@
],
deps = [
":frontend_lib",
- "@pydeps//gevent",
- "@pydeps//gunicorn",
+ requirement("gevent"),
+ requirement("gunicorn"),
+ requirement("greenlet"),
],
visibility = [
"//bgpwtf/cccampix:__pkg__",
],
legacy_create_init = False,
zip_safe = False,
- no_remove = True,
+ #no_remove = True,
)
diff --git a/bgpwtf/cccampix/proto/BUILD.bazel b/bgpwtf/cccampix/proto/BUILD.bazel
index 22c557e..740fef7 100644
--- a/bgpwtf/cccampix/proto/BUILD.bazel
+++ b/bgpwtf/cccampix/proto/BUILD.bazel
@@ -1,6 +1,7 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
-load("@build_stack_rules_proto//python:python_grpc_compile.bzl", "python_grpc_compile")
+load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library")
+
proto_library(
name = "ix_proto",
@@ -23,16 +24,15 @@
visibility = ["//visibility:public"],
)
-python_grpc_compile(
- name = "ix_py_proto_src",
+py_proto_library(
+ name = "ix_py_proto",
deps = [":ix_proto"],
+ visibility = ["//visibility:public"],
)
-py_library(
- name = "ix_py_proto",
- srcs = ["ix_py_proto_src"],
+py_grpc_library(
+ name = "ix_grpc_proto",
+ srcs = [":ix_proto"],
+ deps = [":ix_py_proto"],
visibility = ["//visibility:public"],
- deps = [
- "@pydeps//protobuf",
- ],
)