Skip to content

Commit ce6d3aa

Browse files
committed
Depend on protobuf 3.20.3 for Python 3.9 and 3.10 and on 4.25.2 for Python 3.11.
PiperOrigin-RevId: 612880486
1 parent 04fcb1a commit ce6d3aa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
(previously was 16.04).
1111
* Depends on `tensorflow>=2.15.0,<3`.
1212
* Bumped the minimum bazel version required to build `struct2tensor` to 6.1.0.
13+
* Depends on `protobuf>=4.25.2,<5` for Python 3.11 and on `protobuf>3.20.3,<5`
14+
for 3.9 and 3.10.
1315

1416
## Breaking Changes
1517

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
"""Setup for pip package."""
1616

1717
import os
18+
import sys
1819

1920
from setuptools import find_packages
2021
from setuptools import setup
2122
from setuptools.command.install import install
2223
from setuptools.dist import Distribution
2324

25+
_IS_PY311 = sys.version_info >= (3, 11)
26+
2427

2528
# struct2tensor is not a purelib. However because of the extension module is not
2629
# built by setuptools, it will be incorrectly treated as a purelib. The
@@ -77,7 +80,7 @@ def select_constraint(default, nightly=None, git_master=None):
7780
# TODO(b/263060885): Remove the explicit numpy dependency once TF works
7881
# with numpy>=1.24.
7982
'numpy>=1.22',
80-
'protobuf>=3.20.3,<5',
83+
f'protobuf>={"4.25.2" if _IS_PY311 else "3.20.3"},<5',
8184
'tensorflow>=2.15,<3',
8285
'tensorflow-metadata' + select_constraint(
8386
default='>=1.14.0,<1.15.0',

0 commit comments

Comments
 (0)