From 966d976792e4ef19b4a55bc02350ece83ac3ba0b Mon Sep 17 00:00:00 2001 From: Raviteja Gorijala Date: Mon, 16 Dec 2024 15:03:29 -0800 Subject: [PATCH] Set HERMETIC_PYTHON_VERSION correctly PiperOrigin-RevId: 706847683 --- oss_scripts/configure.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/oss_scripts/configure.sh b/oss_scripts/configure.sh index 9e541eee6..a7f4e96a6 100755 --- a/oss_scripts/configure.sh +++ b/oss_scripts/configure.sh @@ -61,7 +61,13 @@ elif (which python) | grep -q "python"; then installed_python="python" fi -HERMETIC_PYTHON_VERSION=$($installed_python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") +if [ -z "$HERMETIC_PYTHON_VERSION" ]; then + if [ -n "$PY_VERSION" ]; then + HERMETIC_PYTHON_VERSION=$PY_VERSION + else + HERMETIC_PYTHON_VERSION=$($installed_python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") + fi +fi export HERMETIC_PYTHON_VERSION echo "TF_VERSION=$TF_VERSION"