Skip to content

Commit

Permalink
feat(query): pyenv 3.12.2 (#15512)
Browse files Browse the repository at this point in the history
* feat(query): ensure git is installed in pyenv

* refactor(query): pyenv to 3.9

* refactor(query): pyenv to 3.12

* refactor(query): pyenv to 3.12

* refactor(query): pyenv to 3.12

* refactor(query): pyenv to 3.12

* refactor(query): revert workflow

* refactor(query): revert workflow
  • Loading branch information
sundy-li authored May 14, 2024
1 parent fcbdce8 commit 185a47b
Showing 1 changed file with 38 additions and 9 deletions.
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

0 comments on commit 185a47b

Please sign in to comment.