AnandInguva commented on code in PR #28385:
URL: https://github.com/apache/beam/pull/28385#discussion_r1332162411


##########
sdks/python/scripts/run_tox.sh:
##########
@@ -53,18 +53,32 @@ if [[ "$JENKINS_HOME" != "" ]]; then
   export PY_COLORS=1
 fi
 
-if [[ ! -z $2 ]]; then
+# Determine if the second argument is SDK_LOCATION or posargs
+if [[ -f "$1" ]]; then  # Check if the argument corresponds to a file
   SDK_LOCATION="$1"
-  shift;
-  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION" -- "$@"
-else
-  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT"
+  shift
+fi
+
+# If SDK_LOCATION is identified and there are still arguments left, those are 
posargs.
+# If SDK_LOCATION is not identified, all remaining arguments are posargs.
+
+if [[ ! -z "$SDK_LOCATION" ]]; then
+  if [[ $# -gt 0 ]]; then  # There are posargs
+    tox -rvv -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION" -- "$@"
+  else
+    tox -rvv -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION"
+  fi
+else  # No SDK_LOCATION; all arguments are posargs
+  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" -- "$@"

Review Comment:
   Pylint, mypy, docs etc. Tox will take. care of packaging for us in that 
case. 



-- 
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]

Reply via email to