Skip to content

Commit

Permalink
Set HERMETIC_PYTHON_VERSION correctly
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 706847683
  • Loading branch information
rtg0795 authored and tf-text-github-robot committed Dec 16, 2024
1 parent 534859c commit 966d976
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oss_scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 966d976

Please sign in to comment.