From a5738c1cdd3422b0cbb4a6049aa0e01ab3657e1b Mon Sep 17 00:00:00 2001 From: tvalentyn Date: Mon, 3 Jun 2024 20:44:37 -0700 Subject: [PATCH] Extract latest beam version directly from the request (#31487) Co-authored-by: Yi Hu --- .github/trigger_files/beam_PostCommit_XVR_Flink.json | 3 ++- .../beam/sdk/extensions/python/bootstrap_beam_venv.py | 10 +--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/trigger_files/beam_PostCommit_XVR_Flink.json b/.github/trigger_files/beam_PostCommit_XVR_Flink.json index c4edaa85a89d1..e3d6056a5de96 100644 --- a/.github/trigger_files/beam_PostCommit_XVR_Flink.json +++ b/.github/trigger_files/beam_PostCommit_XVR_Flink.json @@ -1,3 +1,4 @@ { - "comment": "Modify this file in a trivial way to cause this test suite to run" + "comment": "Modify this file in a trivial way to cause this test suite to run", + "modification": 1 } diff --git a/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py b/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py index 3d4a519a96f9b..f71a0b784bfd9 100644 --- a/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py +++ b/sdks/java/extensions/python/src/main/resources/org/apache/beam/sdk/extensions/python/bootstrap_beam_venv.py @@ -30,7 +30,6 @@ import shutil import subprocess import sys -from pkg_resources import parse_version def main(): @@ -63,14 +62,7 @@ def main(): if options.beam_version == 'latest': info = json.load( urllib.request.urlopen("https://pypi.org/pypi/apache_beam/json")) - - def maybe_strict_version(s): - try: - return parse_version(s) - except: - return parse_version('0.0') - - beam_version = max(info['releases'], key=maybe_strict_version) + beam_version = info['info']['version'] beam_package = 'apache_beam[gcp,aws,azure,dataframe]==' + beam_version elif (os.path.exists(options.beam_version) or options.beam_version.startswith('http://')