Skip to content

Commit d28bb99

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

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

setup.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313
# limitations under the License.
1414
"""Package Setup script for tf.Transform."""
1515
import os
16-
import sys
1716

1817
from setuptools import find_packages
1918
from setuptools import setup
2019

2120

22-
_IS_PY311 = sys.version_info >= (3, 11)
23-
24-
2521
def select_constraint(default, nightly=None, git_master=None):
2622
"""Select dependency constraint based on TFX_DEPENDENCY_SELECTOR env var."""
2723
selector = os.environ.get('TFX_DEPENDENCY_SELECTOR')
@@ -47,9 +43,11 @@ def _make_required_install_packages():
4743
# protobuf) with TF and pyarrow version with tfx-bsl.
4844
return [
4945
'absl-py>=0.9,<2.0.0',
50-
f'apache-beam[gcp]>={"2.53" if _IS_PY311 else "2.47"},<3',
46+
'apache-beam[gcp]>=2.53,<3;python_version>="3.11"',
47+
'apache-beam[gcp]>=2.47,<3;python_version<"3.11"',
5148
'numpy>=1.22.0',
52-
f'protobuf>={"4.25.2" if _IS_PY311 else "3.20.3"},<5',
49+
'protobuf>=4.25.2,<5;python_version>="3.11"',
50+
'protobuf>=3.20.3,<5;python_version<"3.11"',
5351
'pyarrow>=10,<11',
5452
'pydot>=1.2,<2',
5553
'tensorflow>=2.15,<3',

0 commit comments

Comments
 (0)