Skip to content

Commit

Permalink
avoid using realpath
Browse files Browse the repository at this point in the history
  • Loading branch information
jtattermusch committed Sep 27, 2022
1 parent de0def2 commit 2710d52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
14 changes: 1 addition & 13 deletions tools/run_tests/helper_scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ function toolchain() {
fi
}

# Command to invoke the linux command `realpath` or equivalent.
function script_realpath() {
# Find `realpath`
if [ -x "$(command -v realpath)" ]; then
realpath "$@"
else
# emulate realpath on mac (avoids using grealpath which needs "brew install coreutils")
# TODO(jtattermusch): is using script_realpath really needed?
${PYTHON} -c 'import os; import sys; print(os.path.realpath(sys.argv[1]))' "$1"
fi
}

####################
# Script Arguments #
####################
Expand Down Expand Up @@ -137,7 +125,7 @@ else
# Instantiate the virtualenv from the Python version passed in.
$PYTHON -m pip install --user virtualenv==20.0.23
$PYTHON -m virtualenv "$VENV"
VENV_PYTHON=$(script_realpath "$VENV/$VENV_RELATIVE_PYTHON")
VENV_PYTHON="$(pwd)/$VENV/$VENV_RELATIVE_PYTHON"
fi


Expand Down
3 changes: 2 additions & 1 deletion tools/run_tests/helper_scripts/run_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ set -ex
# change to grpc repo root
cd "$(dirname "$0")/../../.."

PYTHON=$(realpath "${1:-py37/bin/python}")
# TODO(jtattermusch): is the $(pwd) prefix actually useful?
PYTHON="$(pwd)/${1:-py37/bin/python}"

ROOT=$(pwd)

Expand Down

0 comments on commit 2710d52

Please sign in to comment.