From 185a47b713625e13b01cbfc97a463d570f762d51 Mon Sep 17 00:00:00 2001 From: sundyli <543950155@qq.com> Date: Tue, 14 May 2024 11:29:25 +0800 Subject: [PATCH] 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 --- scripts/setup/dev_setup.sh | 47 ++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/scripts/setup/dev_setup.sh b/scripts/setup/dev_setup.sh index 17be3c1c69762..738834657b573 100755 --- a/scripts/setup/dev_setup.sh +++ b/scripts/setup/dev_setup.sh @@ -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 @@ -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 { @@ -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