From de555f34c0df65bfc6c719c3002ca4d384b33f28 Mon Sep 17 00:00:00 2001 From: ml-metadata-team Date: Mon, 4 Mar 2024 19:43:05 -0800 Subject: [PATCH] Depend on protobuf 3.20.3 for Python 3.9 and 3.10 and on 4.25.2 for Python 3.11. PiperOrigin-RevId: 612672251 --- RELEASE.md | 3 ++- setup.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 52107cff0..ce8731a43 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -21,7 +21,8 @@ ## Bug Fixed and Other Changes * Depends on `attrs>=20.3,<24`. -* Depends on `protobuf>=3.13,<5`. +* Depends on `protobuf>=4.25.2,<5` for Python 3.11 and on `protobuf>3.20.3,<5` + for 3.9 and 3.10. # Version 1.14.0 diff --git a/setup.py b/setup.py index e3350a509..51982f0bd 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ import platform import shutil import subprocess +import sys import setuptools from setuptools import find_packages @@ -30,6 +31,8 @@ from distutils.command import build # pylint: enable=g-bad-import-order +_IS_PY311 = sys.version_info >= (3, 11) + class _BuildCommand(build.build): """Build everything that is needed to install. @@ -160,7 +163,7 @@ def run(self): 'absl-py>=0.9,<2.0.0', 'attrs>=20.3,<24', 'grpcio>=1.8.6,<2', - 'protobuf>=3.13,<5', + f'protobuf>={"4.25.2" if _IS_PY311 else "3.20.3"},<5', 'six>=1.10,<2', ], python_requires='>=3.9,<4',