A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/protocolbuffers/protobuf/commit/a4be867133971b21f0fa4a7523733dd1b62db4c1 below:

Loosen py_proto_library check to be on the import path instead of ful… · protocolbuffers/protobuf@a4be867 · GitHub

File tree Expand file treeCollapse file tree 7 files changed

+53

-4

lines changed

Filter options

Expand file treeCollapse file tree 7 files changed

+53

-4

lines changed Original file line number Diff line number Diff line change

@@ -69,4 +69,6 @@ jobs:

69 69

credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}

70 70

bazel-cache: examples

71 71

version: ${{ matrix.bazelversion }}

72 -

bash: cd examples && bazel build //... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }}

72 +

bash: >

73 +

cd examples;

74 +

bazel build //... @com_google_protobuf-examples-with-hyphen//... $BAZEL_FLAGS --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }} ${{ matrix.toolchain_resolution }};

Original file line number Diff line number Diff line change

@@ -44,8 +44,9 @@ def _py_proto_aspect_impl(target, ctx):

44 44 45 45

# Check Proto file names

46 46

for proto in target[ProtoInfo].direct_sources:

47 -

if proto.is_source and "-" in proto.dirname:

48 -

fail("Cannot generate Python code for a .proto whose path contains '-' ({}).".format(

47 +

import_path = proto_common.get_import_path(proto)

48 +

if proto.is_source and "-" in import_path:

49 +

fail("Cannot generate Python code for a .proto whose python import path contains '-' ({}).".format(

49 50

proto.path,

50 51

))

51 52 Original file line number Diff line number Diff line change

@@ -12,6 +12,12 @@ local_path_override(

12 12

path = "..",

13 13

)

14 14 15 +

bazel_dep(name = "com_google_protobuf-examples-with-hyphen", version = "0.0.0", dev_dependency = True)

16 +

local_path_override(

17 +

module_name = "com_google_protobuf-examples-with-hyphen",

18 +

path = "examples_with_hyphen",

19 +

)

20 + 15 21

bazel_dep(name = "bazel_skylib", version = "1.7.1")

16 22

bazel_dep(name = "platforms", version = "0.0.10")

17 23

bazel_dep(name = "rules_cc", version = "0.0.17")

Original file line number Diff line number Diff line change

@@ -20,6 +20,11 @@ local_repository(

20 20

path = "..",

21 21

)

22 22 23 +

local_repository(

24 +

name = "com_google_protobuf-examples-with-hyphen",

25 +

path = "examples_with_hyphen",

26 +

)

27 + 23 28

# Similar to com_google_protobuf but for Java lite. If you are building

24 29

# for Android, the lite version should be preferred because it has a much

25 30

# smaller code size.

@@ -38,7 +43,7 @@ http_archive(

38 43

],

39 44

)

40 45 41 -

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps", "PROTOBUF_MAVEN_ARTIFACTS")

46 +

load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")

42 47 43 48

protobuf_deps()

44 49

@@ -61,12 +66,15 @@ rules_cc_dependencies()

61 66

rules_cc_toolchains()

62 67 63 68

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

69 + 64 70

rules_jvm_external_deps()

65 71 66 72

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

73 + 67 74

rules_jvm_external_setup()

68 75 69 76

load("@rules_jvm_external//:defs.bzl", "maven_install")

77 + 70 78

maven_install(

71 79

name = "maven",

72 80

artifacts = PROTOBUF_MAVEN_ARTIFACTS,

Original file line number Diff line number Diff line change

@@ -0,0 +1,14 @@

1 +

load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")

2 +

load("@com_google_protobuf//bazel:py_proto_library.bzl", "py_proto_library")

3 + 4 +

proto_library(

5 +

name = "empty_proto",

6 +

srcs = ["empty.proto"],

7 +

)

8 + 9 +

# py_proto_library rule with hyphen in @com_google_protobuf-examples-with-hyphen module name.

10 +

py_proto_library(

11 +

name = "empty_py_pb2",

12 +

visibility = ["//visibility:public"],

13 +

deps = [":empty_proto"],

14 +

)

Original file line number Diff line number Diff line change

@@ -0,0 +1,13 @@

1 +

"""Bazel module dependencies"""

2 + 3 +

module(

4 +

name = "com_google_protobuf-examples-with-hyphen",

5 +

version = "0.0.0",

6 +

compatibility_level = 1,

7 +

)

8 + 9 +

bazel_dep(name = "protobuf", version = "0.0.0", repo_name = "com_google_protobuf")

10 +

local_path_override(

11 +

module_name = "protobuf",

12 +

path = "..",

13 +

)

Original file line number Diff line number Diff line change

@@ -0,0 +1,5 @@

1 +

edition = "2023";

2 + 3 +

package examples.with.hyphen;

4 + 5 +

message EmptyMessage {}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4