2022-11-30 15:11:26 -08:00
|
|
|
#!/usr/bin/env bash
|
2025-12-11 11:22:08 -08:00
|
|
|
set -euo pipefail
|
2020-01-17 10:22:00 -08:00
|
|
|
|
2024-06-18 14:27:28 -04:00
|
|
|
# Increase the pip timeout to handle TimeoutError
|
|
|
|
|
export PIP_DEFAULT_TIMEOUT=200
|
|
|
|
|
|
2022-01-02 14:47:16 -08:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
2024-10-13 17:55:06 +01:00
|
|
|
ROOT="$DIR"/../
|
|
|
|
|
cd "$ROOT"
|
2022-01-02 14:47:16 -08:00
|
|
|
|
2024-06-27 17:04:05 -07:00
|
|
|
if ! command -v "uv" > /dev/null 2>&1; then
|
|
|
|
|
echo "installing uv..."
|
2025-12-11 11:22:08 -08:00
|
|
|
curl -LsSf --retry 5 --retry-delay 5 --retry-all-errors https://astral.sh/uv/install.sh | sh
|
2024-11-09 22:16:41 -08:00
|
|
|
UV_BIN="$HOME/.local/bin"
|
|
|
|
|
PATH="$UV_BIN:$PATH"
|
2024-05-26 21:21:50 -07:00
|
|
|
fi
|
2020-10-21 11:36:18 -07:00
|
|
|
|
2024-06-27 17:47:13 -07:00
|
|
|
echo "updating uv..."
|
2025-02-02 21:45:07 -08:00
|
|
|
# ok to fail, can also fail due to installing with brew
|
|
|
|
|
uv self update || true
|
2024-06-27 17:47:13 -07:00
|
|
|
|
2024-06-27 17:04:05 -07:00
|
|
|
echo "installing python packages..."
|
2024-08-14 12:11:39 -07:00
|
|
|
uv sync --frozen --all-extras
|
2024-06-27 17:04:05 -07:00
|
|
|
source .venv/bin/activate
|
2022-01-02 14:47:16 -08:00
|
|
|
|
2023-08-21 13:30:48 -07:00
|
|
|
if [[ "$(uname)" == 'Darwin' ]]; then
|
2025-06-19 12:36:38 -07:00
|
|
|
touch "$ROOT"/.env
|
2024-10-13 17:55:06 +01:00
|
|
|
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> "$ROOT"/.env
|
2023-08-21 13:30:48 -07:00
|
|
|
fi
|