Skip to content

Commit d31c6b3

Browse files
iindyktfx-copybara
authored andcommitted
Switch to PEP 508 style conditional dependencies.
PiperOrigin-RevId: 612943796
1 parent ce6d3aa commit d31c6b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setup.py

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

1717
import os
18-
import sys
1918

2019
from setuptools import find_packages
2120
from setuptools import setup
2221
from setuptools.command.install import install
2322
from setuptools.dist import Distribution
2423

25-
_IS_PY311 = sys.version_info >= (3, 11)
26-
2724

2825
# struct2tensor is not a purelib. However because of the extension module is not
2926
# built by setuptools, it will be incorrectly treated as a purelib. The
@@ -80,7 +77,8 @@ def select_constraint(default, nightly=None, git_master=None):
8077
# TODO(b/263060885): Remove the explicit numpy dependency once TF works
8178
# with numpy>=1.24.
8279
'numpy>=1.22',
83-
f'protobuf>={"4.25.2" if _IS_PY311 else "3.20.3"},<5',
80+
'protobuf>=4.25.2,<5;python_version>="3.11"',
81+
'protobuf>=3.20.3,<5;python_version<"3.11"',
8482
'tensorflow>=2.15,<3',
8583
'tensorflow-metadata' + select_constraint(
8684
default='>=1.14.0,<1.15.0',

0 commit comments

Comments
 (0)