Skip to content

Commit b0039ee

Browse files
committed
_proto_py_pb2 -> _py_pb2
1 parent d61aad1 commit b0039ee

File tree

14 files changed

+16
-16
lines changed

14 files changed

+16
-16
lines changed

examples/bzlmod/py_proto_library/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ py_test(
66
srcs = ["test.py"],
77
main = "test.py",
88
deps = [
9-
"//py_proto_library/example.com/proto:pricetag_proto_py_pb2",
9+
"//py_proto_library/example.com/proto:pricetag_py_pb2",
1010
],
1111
)
1212

1313
py_test(
1414
name = "message_test",
1515
srcs = ["message_test.py"],
1616
deps = [
17-
"//py_proto_library/example.com/another_proto:message_proto_py_pb2",
17+
"//py_proto_library/example.com/another_proto:message_py_pb2",
1818
],
1919
)
2020

examples/bzlmod/py_proto_library/example.com/another_proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
22
load("@rules_python//python:proto.bzl", "py_proto_library")
33

44
py_proto_library(
5-
name = "message_proto_py_pb2",
5+
name = "message_py_pb2",
66
visibility = ["//visibility:public"],
77
deps = [":message_proto"],
88
)

examples/bzlmod/py_proto_library/example.com/proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
22
load("@rules_python//python:proto.bzl", "py_proto_library")
33

44
py_proto_library(
5-
name = "pricetag_proto_py_pb2",
5+
name = "pricetag_py_pb2",
66
visibility = ["//visibility:public"],
77
deps = [":pricetag_proto"],
88
)

examples/py_proto_library/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ py_test(
55
srcs = ["test.py"],
66
main = "test.py",
77
deps = [
8-
"//example.com/proto:pricetag_proto_py_pb2",
8+
"//example.com/proto:pricetag_py_pb2",
99
],
1010
)
1111

1212
py_test(
1313
name = "message_test",
1414
srcs = ["message_test.py"],
1515
deps = [
16-
"//example.com/another_proto:message_proto_py_pb2",
16+
"//example.com/another_proto:message_py_pb2",
1717
],
1818
)

examples/py_proto_library/example.com/another_proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
22
load("@rules_python//python:proto.bzl", "py_proto_library")
33

44
py_proto_library(
5-
name = "message_proto_py_pb2",
5+
name = "message_py_pb2",
66
visibility = ["//visibility:public"],
77
deps = [":message_proto"],
88
)

examples/py_proto_library/example.com/proto/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
22
load("@rules_python//python:proto.bzl", "py_proto_library")
33

44
py_proto_library(
5-
name = "pricetag_proto_py_pb2",
5+
name = "pricetag_py_pb2",
66
visibility = ["//visibility:public"],
77
deps = [":pricetag_proto"],
88
)

gazelle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ proto_library(
513513
)
514514

515515
py_proto_library(
516-
name = "foo_proto_py_pb2",
516+
name = "foo_py_pb2",
517517
visibility = ["//:__subpackages__"],
518518
deps = [":foo_proto"],
519519
)

gazelle/python/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ func generateProtoLibraries(args language.GenerateArgs, pythonProjectRoot string
580580
emptySiblings := treeset.Set{}
581581
// Generate a py_proto_library for each proto_library.
582582
for _, protoRuleName := range protoRuleNames {
583-
pyProtoLibraryName := protoRuleName + "_py_pb2"
583+
pyProtoLibraryName := strings.TrimSuffix(protoRuleName, "_proto") + "_py_pb2"
584584
pyProtoLibrary := newTargetBuilder(pyProtoLibraryKind, pyProtoLibraryName, pythonProjectRoot, args.Rel, &emptySiblings).
585585
addVisibility(visibility).
586586
addResolvedDependency(":" + protoRuleName).

gazelle/python/testdata/directive_python_generate_proto/test5_enabled_with_proto/BUILD.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ proto_library(
1010
)
1111

1212
py_proto_library(
13-
name = "foo_proto_py_pb2",
13+
name = "foo_py_pb2",
1414
visibility = ["//:__subpackages__"],
1515
deps = [":foo_proto"],
1616
)

gazelle/python/testdata/directive_python_generate_proto/test7_removes_when_unnecessary/BUILD.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ proto_library(
1010
)
1111

1212
py_proto_library(
13-
name = "foo_proto_py_pb2",
13+
name = "foo_py_pb2",
1414
visibility = ["//:__subpackages__"],
1515
deps = [":foo_proto"],
1616
)

0 commit comments

Comments
 (0)