From 77093a0ce6c00862aff1e1cb308af4635a330ea1 Mon Sep 17 00:00:00 2001 From: guessthepw Date: Sun, 25 Jan 2026 12:47:45 -0500 Subject: [PATCH] Adds Python support via mise version manager Integrates Python as a selectable component alongside existing Node.js and Erlang options Updates component descriptions to reflect mise's expanded language support Includes pip upgrade during Python installation for package management Fixes Tidewave CLI download URL and architecture detection for improved reliability --- setup_env.sh | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/setup_env.sh b/setup_env.sh index ee5eba4..6067772 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -284,11 +284,12 @@ if [[ "$(uname -s)" == "Darwin" ]]; then # ---- Interactive component selection ---- # Component IDs and descriptions - COMP_IDS=(postgresql mise node erlang chromium vnc ollama claude opencode playwright plugins) + COMP_IDS=(postgresql mise node python erlang chromium vnc ollama claude opencode playwright plugins) COMP_NAMES=( "PostgreSQL" "mise" "Node.js (LTS)" + "Python (latest)" "Erlang/Elixir" "Chromium" "VNC + XFCE" @@ -300,8 +301,9 @@ if [[ "$(uname -s)" == "Darwin" ]]; then ) COMP_DESCS=( "Database server for local development" - "Version manager for Node.js, Erlang, Elixir" + "Version manager for Node.js, Python, Erlang, Elixir" "JavaScript runtime (required for Claude/OpenCode)" + "Python runtime managed by mise" "BEAM VM + Elixir functional language" "Browser for automation and testing" "Remote desktop for browser-based login flows" @@ -931,6 +933,15 @@ install_node() { export PATH="$HOME/.local/share/mise/shims:$PATH" } +install_python() { + export PATH="$HOME/.local/bin:$PATH" + eval "$(~/.local/bin/mise activate bash)" + mise use -g python@latest + export PATH="$HOME/.local/share/mise/shims:$PATH" + # Ensure pip is available via mise python + python -m pip install --upgrade pip +} + install_erlang() { export PATH="$HOME/.local/bin:$PATH" eval "$(~/.local/bin/mise activate bash)" @@ -1094,17 +1105,22 @@ install_tidewave() { return 0 fi - # Download Tidewave CLI binary - local arch - arch=$(detect_architecture) + # Download Tidewave CLI binary from tidewave_app releases + # Binary naming: tidewave-cli--unknown-linux-musl + local machine_arch + machine_arch=$(uname -m) local tidewave_arch="" - case "$arch" in - amd64) tidewave_arch="x86_64-unknown-linux-gnu" ;; - arm64) tidewave_arch="aarch64-unknown-linux-gnu" ;; + case "$machine_arch" in + x86_64) tidewave_arch="x86_64" ;; + aarch64) tidewave_arch="aarch64" ;; + *) + log_error "Unsupported architecture for Tidewave: $machine_arch" + return 1 + ;; esac - # Get latest release URL from GitHub - local release_url="https://github.com/tidewave-ai/tidewave/releases/latest/download/tidewave-${tidewave_arch}" + # Get latest release URL from GitHub (tidewave_app repo) + local release_url="https://github.com/tidewave-ai/tidewave_app/releases/latest/download/tidewave-cli-${tidewave_arch}-unknown-linux-musl" # Security: Download to temp file first, validate, then install local temp_file @@ -1296,6 +1312,7 @@ register_step "base" "System packages (git, build tools, curl)" register_step "postgresql" "PostgreSQL database server" register_step "mise" "mise version manager" register_step "node" "Node.js LTS runtime" +register_step "python" "Python (mise-managed)" register_step "erlang" "Erlang/OTP VM" register_step "elixir" "Elixir language" register_step "chromium" "Chromium browser" @@ -1311,6 +1328,7 @@ register_step "plugins" "Claude Code plugins" should_skip "postgresql" && skip_step "postgresql" should_skip "mise" && skip_step "mise" should_skip "node" && skip_step "node" +should_skip "python" && skip_step "python" should_skip "erlang" && skip_step "erlang" should_skip "chromium" && skip_step "chromium" should_skip "vnc" && skip_step "vnc" @@ -1326,9 +1344,11 @@ should_skip "plugins" && skip_step "plugins" # Tidewave skipped if Erlang skipped (it's for Phoenix/Elixir projects) [ "${STEP_STATUS[erlang]}" = "skipped" ] && skip_step "tidewave" +# Python skipped if mise skipped +[ "${STEP_STATUS[mise]}" = "skipped" ] && skip_step "python" + # Claude/OpenCode/Playwright skipped if Node skipped if [ "${STEP_STATUS[node]}" = "skipped" ]; then - [ "${STEP_STATUS[mise]}" = "skipped" ] || true # mise can still install skip_step "claude" skip_step "opencode" skip_step "playwright" @@ -1369,10 +1389,11 @@ run_step_sync "base" install_base_deps || true wait_for_running_steps # ============================================================================ -# Phase 3: Node + Erlang (parallel, both need mise) +# Phase 3: Node + Python + Erlang (parallel, all need mise) # ============================================================================ if [ "${STEP_STATUS[mise]}" = "done" ]; then [ "${STEP_STATUS[node]}" != "skipped" ] && start_step "node" install_node + [ "${STEP_STATUS[python]}" != "skipped" ] && start_step "python" install_python [ "${STEP_STATUS[erlang]}" != "skipped" ] && start_step "erlang" install_erlang wait_for_running_steps fi