Skip to content

Commit

Permalink
Add protoc-gen-validate 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mering committed Dec 14, 2024
1 parent 2da0165 commit afed944
Show file tree
Hide file tree
Showing 6 changed files with 293 additions and 1 deletion.
87 changes: 87 additions & 0 deletions modules/protoc-gen-validate/1.1.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
module(
name = "protoc-gen-validate",
version = "1.1.0",
compatibility_level = 1,
repo_name = "com_envoyproxy_protoc_gen_validate",
)

bazel_dep(
name = "bazel_skylib",
version = "1.4.2",
)
bazel_dep(
name = "gazelle",
version = "0.33.0",
repo_name = "bazel_gazelle",
)
bazel_dep(
name = "protobuf",
version = "23.1",
repo_name = "com_google_protobuf",
)
bazel_dep(
name = "re2",
version = "2021-09-01",
repo_name = "com_googlesource_code_re2",
)
bazel_dep(
name = "rules_cc",
version = "0.0.9",
)
bazel_dep(
name = "rules_go",
version = "0.42.0",
repo_name = "io_bazel_rules_go",
)
bazel_dep(
name = "rules_java",
version = "5.5.0",
)
bazel_dep(
name = "rules_proto",
version = "5.3.0-21.7",
)
bazel_dep(
name = "rules_python",
version = "0.40.0",
)
# -- bazel_dep definitions -- #

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.21.1")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_iancoleman_strcase",
"com_github_lyft_protoc_gen_star_v2",
"org_golang_google_protobuf",
"org_golang_x_net",
)

PYTHON_VERSIONS = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
[
python.toolchain(
is_default = python_version == PYTHON_VERSIONS[-1],
python_version = python_version,
)
for python_version in PYTHON_VERSIONS
]
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
[
pip.parse(
hub_name = "pgv_pip_deps",
python_version = python_version,
requirements_lock = "//python:requirements.txt",
)
for python_version in PYTHON_VERSIONS
]
use_repo(pip, "pgv_pip_deps")
106 changes: 106 additions & 0 deletions modules/protoc-gen-validate/1.1.0/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
From 5f6362975c5ecab82ad9b62af218cd1ea6dea67c Mon Sep 17 00:00:00 2001
From: maleo <[email protected]>
Date: Sat, 14 Dec 2024 10:54:32 +0000
Subject: [PATCH 2/2] Add MODULE.bazel

---
MODULE.bazel | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 MODULE.bazel

diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 0000000..5198241
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,87 @@
+module(
+ name = "protoc-gen-validate",
+ version = "1.1.0",
+ compatibility_level = 1,
+ repo_name = "com_envoyproxy_protoc_gen_validate",
+)
+
+bazel_dep(
+ name = "bazel_skylib",
+ version = "1.4.2",
+)
+bazel_dep(
+ name = "gazelle",
+ version = "0.33.0",
+ repo_name = "bazel_gazelle",
+)
+bazel_dep(
+ name = "protobuf",
+ version = "23.1",
+ repo_name = "com_google_protobuf",
+)
+bazel_dep(
+ name = "re2",
+ version = "2021-09-01",
+ repo_name = "com_googlesource_code_re2",
+)
+bazel_dep(
+ name = "rules_cc",
+ version = "0.0.9",
+)
+bazel_dep(
+ name = "rules_go",
+ version = "0.42.0",
+ repo_name = "io_bazel_rules_go",
+)
+bazel_dep(
+ name = "rules_java",
+ version = "5.5.0",
+)
+bazel_dep(
+ name = "rules_proto",
+ version = "5.3.0-21.7",
+)
+bazel_dep(
+ name = "rules_python",
+ version = "0.40.0",
+)
+# -- bazel_dep definitions -- #
+
+go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
+go_sdk.download(version = "1.21.1")
+
+go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
+go_deps.from_file(go_mod = "//:go.mod")
+use_repo(
+ go_deps,
+ "com_github_iancoleman_strcase",
+ "com_github_lyft_protoc_gen_star_v2",
+ "org_golang_google_protobuf",
+ "org_golang_x_net",
+)
+
+PYTHON_VERSIONS = [
+ "3.9",
+ "3.10",
+ "3.11",
+ "3.12",
+ "3.13",
+]
+python = use_extension("@rules_python//python/extensions:python.bzl", "python")
+[
+ python.toolchain(
+ is_default = python_version == PYTHON_VERSIONS[-1],
+ python_version = python_version,
+ )
+ for python_version in PYTHON_VERSIONS
+]
+pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
+[
+ pip.parse(
+ hub_name = "pgv_pip_deps",
+ python_version = python_version,
+ requirements_lock = "//python:requirements.txt",
+ )
+ for python_version in PYTHON_VERSIONS
+]
+use_repo(pip, "pgv_pip_deps")
--
2.47.1.613.gc27f4b7a9f-goog

67 changes: 67 additions & 0 deletions modules/protoc-gen-validate/1.1.0/patches/pgv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
From 5b78dfbfb8fd2d30b3a4605fd1e3aaeb046ac94d Mon Sep 17 00:00:00 2001
From: maleo <[email protected]>
Date: Sat, 14 Dec 2024 10:54:12 +0000
Subject: [PATCH 1/2] BCR

---
python/BUILD | 1 +
python/requirements.txt | 20 ++++++++++++++++++++
validate/BUILD | 2 +-
3 files changed, 22 insertions(+), 1 deletion(-)
create mode 100644 python/requirements.txt

diff --git a/python/BUILD b/python/BUILD
index bf99c5f..268e4ad 100644
--- a/python/BUILD
+++ b/python/BUILD
@@ -3,6 +3,7 @@ load("@pgv_pip_deps//:requirements.bzl", "all_requirements")

exports_files([
"requirements.in",
+ "requirements.txt",
"setup.cfg",
])

diff --git a/python/requirements.txt b/python/requirements.txt
new file mode 100644
index 0000000..866d40b
--- /dev/null
+++ b/python/requirements.txt
@@ -0,0 +1,20 @@
+#
+# This file is autogenerated by pip-compile with Python 3.11
+# by the following command:
+#
+# pip-compile --output-file=requirements.txt requirements.in
+#
+astunparse==1.6.3
+ # via -r requirements.in
+jinja2==3.1.3
+ # via -r requirements.in
+markupsafe==2.1.5
+ # via jinja2
+protobuf==5.26.0
+ # via -r requirements.in
+six==1.16.0
+ # via astunparse
+validate-email==1.3
+ # via -r requirements.in
+wheel==0.43.0
+ # via astunparse
\ No newline at end of file
diff --git a/validate/BUILD b/validate/BUILD
index a9d38c5..203beb4 100644
--- a/validate/BUILD
+++ b/validate/BUILD
@@ -28,7 +28,7 @@ cc_proto_library(
py_proto_library(
name = "validate_py",
srcs = ["validate.proto"],
- deps = ["@com_google_protobuf//:protobuf_python"],
+ deps = [],
)

go_proto_library(
--
2.47.1.613.gc27f4b7a9f-goog

21 changes: 21 additions & 0 deletions modules/protoc-gen-validate/1.1.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
matrix:
platform:
- debian10
- ubuntu2004
- windows
bazel:
- 6.x
- 7.x
- 8.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--cxxopt=-std=c++14'
build_targets:
- '@protoc-gen-validate//bazel/go:pgv_plugin_go'
- '@protoc-gen-validate//validate:cc_validate'
- '@protoc-gen-validate//validate:go_default_library'
- '@protoc-gen-validate//validate:validate_proto'
10 changes: 10 additions & 0 deletions modules/protoc-gen-validate/1.1.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/bufbuild/protoc-gen-validate/archive/refs/tags/v1.1.0.tar.gz",
"integrity": "sha256-ZO577rTzYpLAn9UrvdIg/GHLXABXC33s3ycbRweqvis=",
"strip_prefix": "protoc-gen-validate-1.1.0",
"patches": {
"pgv.patch": "sha256-hqcGHcl4nyPU5X7y+aTxqRiLJES26+MXppyCbj2RygE=",
"module_dot_bazel.patch": "sha256-eWgCBwkDRyIMt9ri8WyK1m2b+UUAPkRchYFbEmLkyns="
},
"patch_strip": 1
}
3 changes: 2 additions & 1 deletion modules/protoc-gen-validate/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"github:bufbuild/protoc-gen-validate"
],
"versions": [
"1.0.4"
"1.0.4",
"1.1.0"
],
"yanked_versions": {}
}

0 comments on commit afed944

Please sign in to comment.