gemini-code-assist[bot] commented on code in PR #39246:
URL: https://github.com/apache/beam/pull/39246#discussion_r3544915966
##########
release/src/main/python-release/python_release_automation_utils.sh:
##########
@@ -82,23 +82,25 @@ function get_version() {
#######################################
function download_files() {
if [[ $1 = *"wheel"* ]]; then
- if [[ $2 == "python3.7" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.8" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.9" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.10" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
+ if [[ $2 == "python3.10" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.11" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.12" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.13" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.14" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
else
echo "Unable to determine a Beam wheel for interpreter version $2."
exit 1
fi
Review Comment:

The current implementation duplicates a very long wheel filename pattern
five times, which is prone to errors and hard to maintain when adding or
removing Python versions. We can simplify this by using glob pattern matching
and bash parameter expansion to dynamically construct the wheel filename.
```suggestion
if [[ $2 == python3.1[0-4] ]]; then
local py_ver="${2#python}"
py_ver="${py_ver//./}"
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp${py_ver}-cp${py_ver}-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
else
echo "Unable to determine a Beam wheel for interpreter version $2."
exit 1
fi
```
##########
release/src/main/python-release/python_release_automation_utils.sh:
##########
@@ -82,23 +82,25 @@ function get_version() {
#######################################
function download_files() {
if [[ $1 = *"wheel"* ]]; then
- if [[ $2 == "python3.7" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.8" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.9" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.10" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
+ if [[ $2 == "python3.10" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.11" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.12" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.13" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.14" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
else
echo "Unable to determine a Beam wheel for interpreter version $2."
exit 1
fi
- wget -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_WHL*" $RC_STAGING_URL
+ wget -e robots=off -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_WHL*"
$RC_STAGING_URL
Review Comment:

The variable `$RC_STAGING_URL` is unquoted. To prevent potential word
splitting or glob expansion issues if the URL contains special characters, it
should be wrapped in double quotes.
```suggestion
wget -e robots=off -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_WHL*"
"$RC_STAGING_URL"
```
##########
release/src/main/python-release/python_release_automation_utils.sh:
##########
@@ -82,23 +82,25 @@ function get_version() {
#######################################
function download_files() {
if [[ $1 = *"wheel"* ]]; then
- if [[ $2 == "python3.7" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.8" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.9" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
- elif [[ $2 == "python3.10" ]]; then
-
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
+ if [[ $2 == "python3.10" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.11" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.12" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.13" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
+ elif [[ $2 == "python3.14" ]]; then
+
BEAM_PYTHON_SDK_WHL="apache_beam-$VERSION*-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl"
else
echo "Unable to determine a Beam wheel for interpreter version $2."
exit 1
fi
- wget -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_WHL*" $RC_STAGING_URL
+ wget -e robots=off -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_WHL*"
$RC_STAGING_URL
else
- BEAM_PYTHON_SDK_ZIP="apache-beam-$VERSION.tar.gz"
- wget -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_ZIP*" $RC_STAGING_URL
+ BEAM_PYTHON_SDK_ZIP="apache_beam-$VERSION.tar.gz"
+ wget -e robots=off -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_ZIP*"
$RC_STAGING_URL
Review Comment:

The variable `$RC_STAGING_URL` is unquoted. To prevent potential word
splitting or glob expansion issues if the URL contains special characters, it
should be wrapped in double quotes.
```suggestion
wget -e robots=off -r -l2 --no-parent -nd -A "$BEAM_PYTHON_SDK_ZIP*"
"$RC_STAGING_URL"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]