Skip to content

Commit

Permalink
feat(query): build image limit python 3.12.2 (#15501)
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li authored May 13, 2024
1 parent 1ff87bb commit b5ce195
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions scripts/setup/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,35 +131,27 @@ function install_ziglang {
}

function install_python3 {
PACKAGE_MANAGER=$1

echo "==> installing python3..."
echo "==> installing python3 via pyenv..."
curl https://pyenv.run | bash

# Check if pyenv is already initialized in the profile
if ! command -v pyenv >/dev/null; then
# Add PYENV_ROOT to the profile
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $HOME/.profile
# Check if pyenv is in the PATH
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> $HOME/.profile
# Initialize pyenv in the profile
echo 'eval "$(pyenv init -)"' >> ~/.profile
echo "pyenv environment variables have been added to ~/.profile"
else
echo "pyenv is already set in the environment variables."
fi

case "$PACKAGE_MANAGER" in
apt-get)
install_pkg python3-all-dev "$PACKAGE_MANAGER"
install_pkg python3-setuptools "$PACKAGE_MANAGER"
install_pkg python3-pip "$PACKAGE_MANAGER"
install_pkg libcairo2-dev "$PACKAGE_MANAGER"
;;
apk)
install_pkg python3-dev "$PACKAGE_MANAGER"
install_pkg py3-pip "$PACKAGE_MANAGER"
install_pkg libffi-dev "$PACKAGE_MANAGER"
;;
brew | pacman)
install_pkg python3 "$PACKAGE_MANAGER"
install_pkg cairo "$PACKAGE_MANAGER"
;;
yum | dnf)
install_pkg python3-devel "$PACKAGE_MANAGER"
install_pkg cairo-devel "$PACKAGE_MANAGER"
;;
*)
echo "Unable to install python3 with package manager: $PACKAGE_MANAGER"
exit 1
;;
esac
# Source the profile to apply changes to the current session
source $HOME/.profile
# install python3.12
pyenv install 3.12.2
pyenv global 3.12.2
}

function install_openssl {
Expand Down

0 comments on commit b5ce195

Please sign in to comment.