tools: fix setup for directories with spaces (#33769)

Now handles $DIR with spaces. Also fixes UV_BIN variable
pull/33782/head
fishnux 7 months ago committed by GitHub
parent d96a042722
commit 3dd127c5ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      tools/install_python_dependencies.sh
  2. 4
      tools/ubuntu_setup.sh

@ -5,8 +5,8 @@ set -e
export PIP_DEFAULT_TIMEOUT=200 export PIP_DEFAULT_TIMEOUT=200
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT=$DIR/../ ROOT="$DIR"/../
cd $ROOT cd "$ROOT"
# updating uv on macOS results in 403 sometimes # updating uv on macOS results in 403 sometimes
function update_uv() { function update_uv() {
@ -24,9 +24,9 @@ function update_uv() {
if ! command -v "uv" > /dev/null 2>&1; then if ! command -v "uv" > /dev/null 2>&1; then
echo "installing uv..." echo "installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh curl -LsSf https://astral.sh/uv/install.sh | sh
UV_BIN='$HOME/.cargo/env' UV_BIN="$HOME/.cargo/env"
ADD_PATH_CMD=". \"$UV_BIN\"" ADD_PATH_CMD=". \"$UV_BIN\""
eval $ADD_PATH_CMD eval "$ADD_PATH_CMD"
fi fi
echo "updating uv..." echo "updating uv..."
@ -36,9 +36,9 @@ echo "installing python packages..."
uv sync --frozen --all-extras uv sync --frozen --all-extras
source .venv/bin/activate source .venv/bin/activate
echo "PYTHONPATH=${PWD}" > $ROOT/.env echo "PYTHONPATH=${PWD}" > "$ROOT"/.env
if [[ "$(uname)" == 'Darwin' ]]; then if [[ "$(uname)" == 'Darwin' ]]; then
echo "# msgq doesn't work on mac" >> $ROOT/.env echo "# msgq doesn't work on mac" >> "$ROOT"/.env
echo "export ZMQ=1" >> $ROOT/.env echo "export ZMQ=1" >> "$ROOT"/.env
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> $ROOT/.env echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> "$ROOT"/.env
fi fi

@ -6,5 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# NOTE: this is used in a docker build, so do not run any scripts here. # NOTE: this is used in a docker build, so do not run any scripts here.
$DIR/install_ubuntu_dependencies.sh "$DIR"/install_ubuntu_dependencies.sh
$DIR/install_python_dependencies.sh "$DIR"/install_python_dependencies.sh

Loading…
Cancel
Save