Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query): pyenv 3.12.2 #15512

Merged
merged 10 commits into from
May 14, 2024
47 changes: 38 additions & 9 deletions scripts/setup/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,38 @@ function install_python3 {
install_pkg git "$PACKAGE_MANAGER"
fi

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

echo "==> installing python3..."

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

echo "==> installing 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
Expand All @@ -154,9 +183,9 @@ function install_python3 {

# Source the profile to apply changes to the current session
source $HOME/.profile
# install python3.9
pyenv install 3.9
pyenv global 3.9
pyenv install 3.12.2
pyenv global 3.12.2
pip install --upgrade pip setuptools wheel
}

function install_openssl {
Expand Down Expand Up @@ -655,18 +684,18 @@ if [[ "$INSTALL_DEV_TOOLS" == "true" ]]; then
install_pkg graphviz "$PACKAGE_MANAGER"
install_pkg graphviz-dev "$PACKAGE_MANAGER"
fi
python3 -m pip install --quiet boto3 "moto[all]" black shfmt-py toml yamllint
pip install --quiet boto3 "moto[all]" black shfmt-py toml yamllint
# drivers
python3 -m pip install --quiet pymysql sqlalchemy clickhouse_driver
pip install --quiet pymysql sqlalchemy clickhouse_driver
# sqllogic dependencies
python3 -m pip install --quiet mysql-connector-python==8.0.30
pip install --quiet mysql-connector-python==8.0.30
fi

if [[ "$INSTALL_CODEGEN" == "true" ]]; then
install_pkg clang "$PACKAGE_MANAGER"
install_pkg llvm "$PACKAGE_MANAGER"
install_python3 "$PACKAGE_MANAGER"
"${PRE_COMMAND[@]}" python3 -m pip install --quiet coscmd PyYAML
"${PRE_COMMAND[@]}" pip install --quiet coscmd PyYAML
fi

if [[ "$INSTALL_TPCH_DATA" == "true" ]]; then
Expand Down
Loading