Skip to content

Commit 24c5330

Browse files
Merge remote-tracking branch 'upstream/master' into 30-build-workflow
2 parents 6402903 + dd7a252 commit 24c5330

File tree

12 files changed

+64
-57
lines changed

12 files changed

+64
-57
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![PyPI](https://badge.fury.io/py/struct2tensor.svg)](https://badge.fury.io/py/struct2tensor)
55

66
<!--*
7-
freshness: { owner: 'iindyk' reviewed: '2024-04-22' }
7+
freshness: { owner: 'iindyk' reviewed: '2025-04-02' }
88
*-->
99

1010
## Introduction
@@ -115,6 +115,7 @@ is an integer.
115115

116116
struct2tensor | tensorflow
117117
---------------------------------------------------------------------- | ----------
118+
[0.48.0](https://github.com/google/struct2tensor/releases/tag/v0.48.0) | 2.17.0
118119
[0.47.0](https://github.com/google/struct2tensor/releases/tag/v0.47.0) | 2.16.2
119120
[0.46.0](https://github.com/google/struct2tensor/releases/tag/v0.46.0) | 2.15.0
120121
[0.45.0](https://github.com/google/struct2tensor/releases/tag/v0.45.0) | 2.13.0

RELEASE.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `struct2tensor` release notes
22

3-
# Current Version (not yet released; still in development)
3+
## Current Version (not yet released; still in development)
44

55
## Major Features and Improvements
66

@@ -10,7 +10,27 @@
1010

1111
## Deprecations
1212

13-
# Version 0.47.0
13+
## Version 0.48.0
14+
15+
## Major Features and Improvements
16+
17+
* N/A
18+
19+
## Bug Fixes and Other Changes
20+
21+
* Depends on `protobuf>=4.25.2,<6.0.0` for Python 3.11 and on `protobuf>=4.21.6,<6.0.0` for 3.9 and 3.10.
22+
* Depends on `tensorflow 2.17.1`.
23+
* macOS wheel publishing is temporarily paused due to missing ARM64 support.
24+
25+
## Breaking Changes
26+
27+
* N/A
28+
29+
## Deprecations
30+
31+
* N/A
32+
33+
## Version 0.47.0
1434

1535
## Major Features and Improvements
1636

@@ -30,7 +50,7 @@
3050

3151
* N/A
3252

33-
# Version 0.46.0
53+
## Version 0.46.0
3454

3555
## Major Features and Improvements
3656

@@ -53,7 +73,7 @@
5373

5474
* Deprecated python 3.8 support.
5575

56-
# Version 0.45.0
76+
## Version 0.45.0
5777

5878
## Major Features and Improvements
5979

@@ -73,7 +93,7 @@
7393

7494
* N/A
7595

76-
# Version 0.44.0
96+
## Version 0.44.0
7797

7898
## Major Features and Improvements
7999

@@ -93,7 +113,7 @@
93113

94114
* Deprecated python 3.7 support.
95115

96-
# Version 0.43.0
116+
## Version 0.43.0
97117

98118
## Major Features and Improvements
99119

@@ -111,7 +131,7 @@
111131

112132
* N/A
113133

114-
# Version 0.42.0
134+
## Version 0.42.0
115135

116136
## Major Features and Improvements
117137

@@ -130,7 +150,7 @@
130150

131151
* N/A
132152

133-
# Version 0.41.0
153+
## Version 0.41.0
134154

135155
## Major Features and Improvements
136156

@@ -149,7 +169,7 @@
149169

150170
* N/A
151171

152-
# Version 0.40.0
172+
## Version 0.40.0
153173

154174
## Major Features and Improvements
155175

@@ -170,7 +190,7 @@
170190

171191
* N/A
172192

173-
# Version 0.39.0
193+
## Version 0.39.0
174194

175195
## Major Features and Improvements
176196

@@ -188,7 +208,7 @@
188208

189209
* N/A
190210

191-
# Version 0.38.0
211+
## Version 0.38.0
192212

193213
## Major Features and Improvements
194214

@@ -208,7 +228,7 @@
208228

209229
* N/A
210230

211-
# Version 0.37.0
231+
## Version 0.37.0
212232

213233
## Major Features and Improvements
214234

@@ -226,7 +246,7 @@
226246

227247
* N/A
228248

229-
# Version 0.36.0
249+
## Version 0.36.0
230250

231251
## Major Features and Improvements
232252

@@ -245,7 +265,7 @@
245265

246266
* N/A
247267

248-
# Version 0.35.0
268+
## Version 0.35.0
249269

250270
## Major Features and Improvements
251271

@@ -263,7 +283,7 @@
263283

264284
* Deprecated python 3.6 support.
265285

266-
# Version 0.34.0
286+
## Version 0.34.0
267287

268288
## Major Features and Improvements
269289

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ def select_constraint(default, nightly=None, git_master=None):
7979
# TODO(b/263060885): Remove the explicit numpy dependency once TF works
8080
# with numpy>=1.24.
8181
'numpy>=1.22',
82-
'protobuf>=4.25.2,<6;python_version>="3.11"',
83-
'protobuf>=3.20.3,<5;python_version<"3.11"',
84-
'tensorflow>=2.16,<2.17',
82+
'protobuf>=4.25.2,<6.0.0;python_version>="3.11"',
83+
'protobuf>=4.21.6,<6.0.0;python_version<"3.11"',
84+
'tensorflow>=2.17,<2.18',
8585
'tensorflow-metadata'
8686
+ select_constraint(
87-
default='>=1.16.1,<1.17.0',
88-
nightly='>=1.17.0.dev',
87+
default='>=1.17.0,<1.18.0',
88+
nightly='>=1.18.0.dev',
8989
git_master='@git+https://github.com/tensorflow/metadata@master',
9090
),
9191
'pyarrow>=10,<11',

struct2tensor/BUILD

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ s2t_pytype_library(
3737
srcs = [
3838
"__init__.py",
3939
],
40-
srcs_version = "PY3ONLY",
4140
deps = [
4241
":calculate_options",
4342
":expression",
@@ -55,7 +54,6 @@ s2t_pytype_library(
5554
srcs = [
5655
"expression_impl/__init__.py",
5756
],
58-
srcs_version = "PY2AND3",
5957
deps = [
6058
":calculate_options",
6159
":expression",
@@ -84,7 +82,6 @@ s2t_pytype_library(
8482
srcs = [
8583
"path.py",
8684
],
87-
srcs_version = "PY3ONLY",
8885
deps = [
8986
"@com_github_tensorflow_metadata//tensorflow_metadata/proto/v0:py_metadata_v0_proto_py",
9087
"@com_google_protobuf//:protobuf_python",
@@ -100,7 +97,6 @@ s2t_pytype_library(
10097
"prensor_util.py",
10198
"prensor_value.py",
10299
],
103-
srcs_version = "PY3ONLY",
104100
deps = [
105101
":calculate_options",
106102
":path",
@@ -117,7 +113,6 @@ s2t_pytype_library(
117113
srcs = [
118114
"calculate_options.py",
119115
],
120-
srcs_version = "PY3ONLY",
121116
)
122117

123118
# Note: do not separate these, as eventually we want to make sure that they
@@ -146,7 +141,6 @@ s2t_pytype_library(
146141
"expression_impl/size.py",
147142
"expression_impl/slice_expression.py",
148143
],
149-
srcs_version = "PY3ONLY",
150144
deps = [
151145
":calculate_options",
152146
":path",
@@ -163,7 +157,6 @@ s2t_pytype_library(
163157
srcs = [
164158
"expression_impl/map_prensor_to_prensor.py",
165159
],
166-
srcs_version = "PY3ONLY",
167160
deps = [
168161
":expression",
169162
":path",
@@ -176,7 +169,6 @@ s2t_pytype_library(
176169
srcs = [
177170
"expression_impl/placeholder.py",
178171
],
179-
srcs_version = "PY3ONLY",
180172
deps = [
181173
":expression",
182174
":map_prensor_to_prensor",
@@ -190,7 +182,6 @@ s2t_pytype_library(
190182
srcs = [
191183
"expression_impl/parquet.py",
192184
],
193-
srcs_version = "PY3ONLY",
194185
deps = [
195186
":expression",
196187
":map_prensor_to_prensor",
@@ -207,7 +198,6 @@ s2t_pytype_library(
207198
srcs = [
208199
"expression_impl/proto_test_util.py",
209200
],
210-
srcs_version = "PY3ONLY",
211201
deps = [
212202
":expression",
213203
"//struct2tensor/test:test_py_pb2",
@@ -220,7 +210,6 @@ s2t_pytype_library(
220210
srcs = [
221211
"prensor_to_structured_tensor.py",
222212
],
223-
srcs_version = "PY3ONLY",
224213
deps = [
225214
":path",
226215
":prensor",
@@ -232,7 +221,6 @@ s2t_pytype_library(
232221
srcs = [
233222
"structured_tensor_to_prensor.py",
234223
],
235-
srcs_version = "PY3ONLY",
236224
deps = [
237225
":path",
238226
":prensor",

struct2tensor/benchmarks/BUILD

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# Placeholder: load py_binary
1717
# Placeholder: load py_library
1818
# Placeholder: load py_test
19+
load("//third_party/protobuf/bazel:proto_library.bzl", "proto_library")
1920
load("//tools/build_defs/proto/cpp:cc_proto_library.bzl", "cc_proto_library")
2021

2122
licenses(["notice"])
@@ -74,15 +75,13 @@ py_test(
7475
# Follow the instructions in the file to properly run the benchmark.
7576
args = ["--test_mode"],
7677
main = "struct2tensor_benchmark.py",
77-
python_version = "PY3",
7878
shard_count = 4,
7979
deps = [":struct2tensor_benchmark_lib"],
8080
)
8181

8282
py_binary(
8383
name = "struct2tensor_benchmark",
8484
srcs = ["struct2tensor_benchmark.py"],
85-
python_version = "PY3",
8685
deps = [
8786
":struct2tensor_benchmark_lib",
8887
],
@@ -95,15 +94,13 @@ py_test(
9594
# Follow the instructions in the file to properly run the benchmark.
9695
args = ["--test_mode"],
9796
main = "ops_benchmark.py",
98-
python_version = "PY3",
9997
# shard_count = 4,
10098
deps = [":struct2tensor_benchmark_lib"],
10199
)
102100

103101
py_binary(
104102
name = "ops_benchmark",
105103
srcs = ["ops_benchmark.py"],
106-
python_version = "PY3",
107104
deps = [
108105
":struct2tensor_benchmark_lib",
109106
],
@@ -112,7 +109,6 @@ py_binary(
112109
py_library(
113110
name = "struct2tensor_benchmark_util",
114111
srcs = ["struct2tensor_benchmark_util.py"],
115-
srcs_version = "PY3ONLY",
116112
deps = [
117113
"//file/colossus/public:cns",
118114
"//third_party/py/cpuinfo",

struct2tensor/calculate_test.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,22 @@ def test_calculate_mock(self):
8989
self.assertIs(my_input._calculate_output, result)
9090

9191
def test_calculate_broken_mock_is_repeated(self):
92-
with self.assertRaisesRegexp(
92+
with self.assertRaisesRegex(
9393
ValueError,
9494
"Expression Node0 returned the wrong type: expected: repeated <dtype: "
95-
"'int64'> actual: optional <dtype: 'int64'>."):
95+
"'int64'> actual: optional <dtype: 'int64'>.",
96+
):
9697
single_node = expression_test_util.get_mock_broken_leaf(
9798
True, tf.int64, False, tf.int64, name="Node0")
9899
calculate.calculate_values([single_node])
99100

100101
def test_calculate_broken_mock_dtype(self):
101-
with self.assertRaisesRegexp(
102-
ValueError, "Expression Node0 returned the "
102+
with self.assertRaisesRegex(
103+
ValueError,
104+
"Expression Node0 returned the "
103105
"wrong type: expected: repeated <dtype: "
104-
"'int64'> actual: repeated <dtype: 'int32'>."):
106+
"'int64'> actual: repeated <dtype: 'int32'>.",
107+
):
105108
single_node = expression_test_util.get_mock_broken_leaf(
106109
True, tf.int64, True, tf.int32, name="Node0")
107110
calculate.calculate_values([single_node])

struct2tensor/ops/struct2tensor_ops_test.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -592,15 +592,17 @@ def test_unsigned_integer_key_types(self, key_type):
592592
self.assertAllEqual(indices_0, [])
593593

594594
def test_invalid_uint32_key(self):
595-
with self.assertRaisesRegexp(tf.errors.InvalidArgumentError,
596-
"Failed to parse .*string"):
595+
with self.assertRaisesRegex(
596+
tf.errors.InvalidArgumentError, "Failed to parse .*string"
597+
):
597598
self.evaluate(
598599
self._parse_map_entry([test_map_pb2.MessageWithMap()],
599600
"uint32_string_map", ["-42"]))
600601

601602
def test_invalid_int32_key(self):
602-
with self.assertRaisesRegexp(tf.errors.InvalidArgumentError,
603-
"Failed to parse .*string"):
603+
with self.assertRaisesRegex(
604+
tf.errors.InvalidArgumentError, "Failed to parse .*string"
605+
):
604606
self.evaluate(
605607
self._parse_map_entry([test_map_pb2.MessageWithMap()],
606608
"int32_string_map", ["foo"]))
@@ -617,8 +619,9 @@ def test_bool_key_type(self):
617619

618620
def test_invalid_bool_key(self):
619621
message_with_map = test_map_pb2.MessageWithMap()
620-
with self.assertRaisesRegexp(tf.errors.InvalidArgumentError,
621-
"Failed to parse .*string"):
622+
with self.assertRaisesRegex(
623+
tf.errors.InvalidArgumentError, "Failed to parse .*string"
624+
):
622625
self.evaluate(
623626
self._parse_map_entry([message_with_map], "bool_string_map", ["2"]))
624627

0 commit comments

Comments
 (0)