Skip to content

Commit 185a47b

Browse files
authored
feat(query): pyenv 3.12.2 (#15512)
* 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
1 parent fcbdce8 commit 185a47b

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

scripts/setup/dev_setup.sh

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,38 @@ function install_python3 {
136136
install_pkg git "$PACKAGE_MANAGER"
137137
fi
138138

139-
echo "==> installing python3 via pyenv..."
140-
curl https://pyenv.run | bash
139+
PACKAGE_MANAGER=$1
140+
141+
echo "==> installing python3..."
141142

143+
case "$PACKAGE_MANAGER" in
144+
apt-get)
145+
install_pkg python3-all-dev "$PACKAGE_MANAGER"
146+
install_pkg python3-setuptools "$PACKAGE_MANAGER"
147+
install_pkg python3-pip "$PACKAGE_MANAGER"
148+
install_pkg libcairo2-dev "$PACKAGE_MANAGER"
149+
;;
150+
apk)
151+
install_pkg python3-dev "$PACKAGE_MANAGER"
152+
install_pkg py3-pip "$PACKAGE_MANAGER"
153+
install_pkg libffi-dev "$PACKAGE_MANAGER"
154+
;;
155+
brew | pacman)
156+
install_pkg python3 "$PACKAGE_MANAGER"
157+
install_pkg cairo "$PACKAGE_MANAGER"
158+
;;
159+
yum | dnf)
160+
install_pkg python3-devel "$PACKAGE_MANAGER"
161+
install_pkg cairo-devel "$PACKAGE_MANAGER"
162+
;;
163+
*)
164+
echo "Unable to install python3 with package manager: $PACKAGE_MANAGER"
165+
exit 1
166+
;;
167+
esac
168+
169+
echo "==> installing pyenv..."
170+
curl https://pyenv.run | bash
142171
# Check if pyenv is already initialized in the profile
143172
if ! command -v pyenv >/dev/null; then
144173
# Add PYENV_ROOT to the profile
@@ -154,9 +183,9 @@ function install_python3 {
154183

155184
# Source the profile to apply changes to the current session
156185
source $HOME/.profile
157-
# install python3.9
158-
pyenv install 3.9
159-
pyenv global 3.9
186+
pyenv install 3.12.2
187+
pyenv global 3.12.2
188+
pip install --upgrade pip setuptools wheel
160189
}
161190

162191
function install_openssl {
@@ -655,18 +684,18 @@ if [[ "$INSTALL_DEV_TOOLS" == "true" ]]; then
655684
install_pkg graphviz "$PACKAGE_MANAGER"
656685
install_pkg graphviz-dev "$PACKAGE_MANAGER"
657686
fi
658-
python3 -m pip install --quiet boto3 "moto[all]" black shfmt-py toml yamllint
687+
pip install --quiet boto3 "moto[all]" black shfmt-py toml yamllint
659688
# drivers
660-
python3 -m pip install --quiet pymysql sqlalchemy clickhouse_driver
689+
pip install --quiet pymysql sqlalchemy clickhouse_driver
661690
# sqllogic dependencies
662-
python3 -m pip install --quiet mysql-connector-python==8.0.30
691+
pip install --quiet mysql-connector-python==8.0.30
663692
fi
664693

665694
if [[ "$INSTALL_CODEGEN" == "true" ]]; then
666695
install_pkg clang "$PACKAGE_MANAGER"
667696
install_pkg llvm "$PACKAGE_MANAGER"
668697
install_python3 "$PACKAGE_MANAGER"
669-
"${PRE_COMMAND[@]}" python3 -m pip install --quiet coscmd PyYAML
698+
"${PRE_COMMAND[@]}" pip install --quiet coscmd PyYAML
670699
fi
671700

672701
if [[ "$INSTALL_TPCH_DATA" == "true" ]]; then

0 commit comments

Comments
 (0)