-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·33 lines (27 loc) · 1.05 KB
/
install.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# usage: ./install.sh [VENV_PATH]
#
# VENV_PATH: Optional path for the virtual environment (default: ./.venv).
#
# Creates a virtualenv with uv and installs the package with test dependencies.
set -euo pipefail
if ! command -v uv &> /dev/null; then
echo "Error: 'uv' is required but not installed." >&2
echo "Install it with: curl -LsSf https://astral.sh/uv/install.sh | sh" >&2
echo "After installing, open a new shell or run: source ~/.bashrc (or ~/.zshrc)" >&2
exit 1
fi
VENV_PATH="${1:-.venv}"
if [ ! -d "${VENV_PATH}" ]; then
uv venv "${VENV_PATH}"
fi
# shellcheck disable=SC1091
source "${VENV_PATH}/bin/activate"
uv pip install -e ".[test]"
if ! { dpkg-query -W -f='${Status}' libportaudio2 2>/dev/null | grep -q 'install ok installed' || ldconfig -p 2>/dev/null | grep -q 'libportaudio'; }; then
echo "" >&2
echo "Warning: libportaudio2 not found on this system." >&2
echo " Install it with: sudo apt-get install libportaudio2" >&2
echo " (Required for sounddevice; tests will fail without it.)" >&2
fi