Skip to content

Commit 1b05c0e

Browse files
committed
Bump protobuf requirement to 3.12.x (#3132)
Fixes #3110.
1 parent 503bf5a commit 1b05c0e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cirq/google/arg_func_langs_test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ def test_serialize_sympy_constants():
105105
including_default_value_fields=True,
106106
preserving_proto_field_name=True,
107107
use_integers_for_enums=True)
108-
assert packed == {'arg_value': {'float_value': float(np.float32(sympy.pi))}}
108+
# protobuf 3.12+ truncates floats to 4 bytes
109+
assert packed == {
110+
'arg_value': {
111+
'float_value': float(str(np.float32(sympy.pi)))
112+
}
113+
}
109114

110115

111116
def test_unsupported_function_language():

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ matplotlib~=3.0
77
networkx~=2.4
88
numpy~=1.16
99
pandas
10-
protobuf==3.8.0
10+
protobuf~=3.12.0
1111
requests~=2.18
1212
sortedcontainers~=2.0
1313
scipy

0 commit comments

Comments
 (0)