Skip to content

Commit c7d6381

Browse files
Bumps oldest supported TF version to 2.12.
Swaps proto build to @rules_python from @com_google_protobuf (which is causing build failures from *_genproto targets). PiperOrigin-RevId: 580643569
1 parent 81c6b17 commit c7d6381

File tree

10 files changed

+88
-55
lines changed

10 files changed

+88
-55
lines changed

WORKSPACE

+19
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
66
load("@tensorflow_gnn//package:tfdep.bzl", "tf_setup")
77
tf_setup()
88

9+
http_archive(
10+
name = "rules_proto",
11+
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
12+
strip_prefix = "rules_proto-5.3.0-21.7",
13+
urls = [
14+
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
15+
],
16+
)
17+
18+
http_archive(
19+
name = "rules_python",
20+
sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
21+
strip_prefix = "rules_python-0.26.0",
22+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
23+
)
24+
925
# Initialize the TensorFlow repository and all dependencies.
1026
# See @org_tensorflow//WORKSPACE for details.
1127
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")
@@ -17,6 +33,9 @@ tf_workspace1()
1733
load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
1834
tf_workspace0()
1935

36+
load("@rules_python//python:repositories.bzl", "py_repositories")
37+
py_repositories()
38+
2039
# This seems required to avoid a proxy setup.
2140
# TODO(blais): Find a way to get rid of this.
2241
http_archive(

kokoro/github/ubuntu/cpu/oldest/continuous.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env_vars: {
66
}
77
env_vars: {
88
key: "TF_VERSION"
9-
value: "2.10.*"
9+
value: "2.12.*"
1010
}
1111
env_vars: {
1212
key: "TAG_FILTERS"

kokoro/github/ubuntu/cpu/oldest/presubmit.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env_vars: {
66
}
77
env_vars: {
88
key: "TF_VERSION"
9-
value: "2.10.*"
9+
value: "2.12.*"
1010
}
1111
env_vars: {
1212
key: "TAG_FILTERS"

package/BUILD

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ sh_binary(
44
name = "move_generated_files",
55
srcs = ["move_generated_files.sh"],
66
data = [
7-
"//tensorflow_gnn/experimental/sampler:eval_dag_pb2.py",
8-
"//tensorflow_gnn/proto:examples_pb2.py",
9-
"//tensorflow_gnn/proto:graph_schema_pb2.py",
10-
"//tensorflow_gnn/sampler:sampling_spec_pb2.py",
11-
"//tensorflow_gnn/sampler:subgraph_pb2.py",
12-
"//tensorflow_gnn/tools:sampled_stats_pb2.py",
7+
"//tensorflow_gnn/experimental/sampler:eval_dag_py_proto",
8+
"//tensorflow_gnn/proto:examples_py_proto",
9+
"//tensorflow_gnn/proto:graph_schema_py_proto",
10+
"//tensorflow_gnn/sampler:sampling_spec_py_proto",
11+
"//tensorflow_gnn/sampler:subgraph_py_proto",
12+
"//tensorflow_gnn/tools:sampled_stats_py_proto",
1313
],
1414
)

package/tfdep.bzl

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def tf_setup():
1313
"""
1414
http_archive(
1515
name = "org_tensorflow",
16-
sha256 = "99c732b92b1b37fc243a559e02f9aef5671771e272758aa4aec7f34dc92dac48",
16+
sha256 = "c030cb1905bff1d2446615992aad8d8d85cbe90c4fb625cee458c63bf466bc8e",
1717
urls = [
18-
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.11.0.tar.gz",
18+
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.12.0.tar.gz",
1919
],
20-
strip_prefix = "tensorflow-2.11.0",
20+
strip_prefix = "tensorflow-2.12.0",
2121
)

setup.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,10 @@ def get_version():
173173
'networkx',
174174
'pyarrow',
175175
# pylint:disable=g-line-too-long
176-
'tensorflow>=2.10.0; platform_machine != "arm64" or platform_system != "Darwin"',
177-
'tensorflow-macos>=2.10.0; platform_machine == "arm64" and platform_system == "Darwin"',
176+
'tensorflow>=2.12.0; platform_machine != "arm64" or platform_system != "Darwin"',
177+
'tensorflow-macos>=2.12.0; platform_machine == "arm64" and platform_system == "Darwin"',
178178
# pylint:enable=g-line-too-long
179-
# TODO(b/283835852): Unpin beam version when all supported TF versions
180-
# enable protobuf >=3.20
181-
'apache-beam<2.47.0',
179+
'apache-beam',
182180
],
183181
python_requires='>=3.8,<4',
184182
packages=find_namespace_packages(

tensorflow_gnn/experimental/sampler/BUILD

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
1+
load("@rules_proto//proto:defs.bzl", "proto_library")
2+
load("@rules_python//python:proto.bzl", "py_proto_library")
23

34
package(default_visibility = ["//visibility:public"])
45

56
licenses(["notice"]) # Apache 2.0
67

8+
proto_library(
9+
name = "eval_dag_proto",
10+
srcs = ["eval_dag.proto"],
11+
deps = [
12+
"@org_tensorflow//tensorflow/core:protos_all",
13+
],
14+
)
15+
716
py_proto_library(
817
name = "eval_dag_py_proto",
9-
srcs = ["eval_dag.proto"],
10-
default_runtime = "@com_google_protobuf//:protobuf_python",
11-
protoc = "@com_google_protobuf//:protoc",
12-
srcs_version = "PY3",
1318
deps = [
14-
"@com_google_protobuf//:protobuf_python",
15-
"@org_tensorflow//tensorflow/core:protos_all_py",
19+
":eval_dag_proto",
1620
],
1721
)
1822

tensorflow_gnn/proto/BUILD

+18-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ package(default_visibility = ["//visibility:public"])
22

33
licenses(["notice"]) # Apache 2.0
44

5-
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
5+
load("@rules_proto//proto:defs.bzl", "proto_library")
6+
load("@rules_python//python:proto.bzl", "py_proto_library")
67

78
py_library(
89
name = "proto",
@@ -15,15 +16,18 @@ py_library(
1516
],
1617
)
1718

19+
proto_library(
20+
name = "graph_schema_proto",
21+
srcs = ["graph_schema.proto"],
22+
deps = [
23+
"@org_tensorflow//tensorflow/core:protos_all",
24+
],
25+
)
26+
1827
py_proto_library(
1928
name = "graph_schema_py_proto",
20-
srcs = ["graph_schema.proto"],
21-
default_runtime = "@com_google_protobuf//:protobuf_python",
22-
protoc = "@com_google_protobuf//:protoc",
23-
srcs_version = "PY3",
2429
deps = [
25-
"@com_google_protobuf//:protobuf_python",
26-
"@org_tensorflow//tensorflow/core:protos_all_py",
30+
":graph_schema_proto",
2731
],
2832
)
2933

@@ -36,14 +40,15 @@ py_library(
3640
],
3741
)
3842

43+
proto_library(
44+
name = "examples_proto",
45+
srcs = ["examples.proto"],
46+
deps = ["@org_tensorflow//tensorflow/core:protos_all"],
47+
)
48+
3949
py_proto_library(
4050
name = "examples_py_proto",
41-
srcs = ["examples.proto"],
42-
default_runtime = "@com_google_protobuf//:protobuf_python",
43-
protoc = "@com_google_protobuf//:protoc",
44-
srcs_version = "PY3",
4551
deps = [
46-
"@com_google_protobuf//:protobuf_python",
47-
"@org_tensorflow//tensorflow/core:protos_all_py",
52+
":examples_proto",
4853
],
4954
)

tensorflow_gnn/sampler/BUILD

+16-13
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,33 @@ package(default_visibility = ["//visibility:public"])
22

33
licenses(["notice"]) # Apache 2.0
44

5-
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
5+
load("@rules_proto//proto:defs.bzl", "proto_library")
6+
load("@rules_python//python:proto.bzl", "py_proto_library")
67
load("@tensorflow_gnn//tensorflow_gnn:tensorflow_gnn.bzl", "pytype_strict_contrib_test")
78

9+
proto_library(
10+
name = "subgraph_proto",
11+
srcs = ["subgraph.proto"],
12+
deps = ["@org_tensorflow//tensorflow/core:protos_all"],
13+
)
14+
815
py_proto_library(
916
name = "subgraph_py_proto",
10-
srcs = ["subgraph.proto"],
11-
default_runtime = "@com_google_protobuf//:protobuf_python",
12-
protoc = "@com_google_protobuf//:protoc",
13-
srcs_version = "PY3",
1417
deps = [
15-
"@com_google_protobuf//:protobuf_python",
16-
"@org_tensorflow//tensorflow/core:protos_all_py",
18+
":subgraph_proto",
1719
],
1820
)
1921

22+
proto_library(
23+
name = "sampling_spec_proto",
24+
srcs = ["sampling_spec.proto"],
25+
deps = ["@org_tensorflow//tensorflow/core:protos_all"],
26+
)
27+
2028
py_proto_library(
2129
name = "sampling_spec_py_proto",
22-
srcs = ["sampling_spec.proto"],
23-
default_runtime = "@com_google_protobuf//:protobuf_python",
24-
protoc = "@com_google_protobuf//:protoc",
25-
srcs_version = "PY3",
2630
deps = [
27-
"@com_google_protobuf//:protobuf_python",
28-
"@org_tensorflow//tensorflow/core:protos_all_py",
31+
":sampling_spec_proto",
2932
],
3033
)
3134

tensorflow_gnn/tools/BUILD

+10-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ package(default_visibility = ["//visibility:public"])
22

33
licenses(["notice"]) # Apache 2.0
44

5-
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
5+
load("@rules_proto//proto:defs.bzl", "proto_library")
6+
load("@rules_python//python:proto.bzl", "py_proto_library")
7+
load("@tensorflow_gnn//tensorflow_gnn:tensorflow_gnn.bzl", "pytype_strict_contrib_test")
8+
9+
proto_library(
10+
name = "sampled_stats_proto",
11+
srcs = ["sampled_stats.proto"],
12+
deps = ["@org_tensorflow//tensorflow/core:protos_all"],
13+
)
614

715
py_proto_library(
816
name = "sampled_stats_py_proto",
9-
srcs = ["sampled_stats.proto"],
10-
default_runtime = "@com_google_protobuf//:protobuf_python",
11-
protoc = "@com_google_protobuf//:protoc",
12-
srcs_version = "PY3",
1317
deps = [
14-
"@com_google_protobuf//:protobuf_python",
18+
":sampled_stats_proto",
1519
],
1620
)

0 commit comments

Comments
 (0)