-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·47 lines (40 loc) · 950 Bytes
/
setup.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# https://docs.astral.sh/uv/getting-started/features/
# Catch --optional flag
if [ "$1" == "--optional" ]; then
echo "Optional dependencies will be installed."
OPTIONAL=true
else
OPTIONAL=false
fi
# If uv is available, use it to install the project
if command -v uv &> /dev/null
then
uv venv
# shellcheck source=.venv/bin/activate
source .venv/bin/activate
if [ "$OPTIONAL" = true ]; then
uv pip install -r pyproject.toml -e . --all-extras
else
uv pip install -r pyproject.toml -e .
fi
else
python3 -m venv venv
# shellcheck source=.venv/bin/activate
source venv/bin/activate
if [ "$OPTIONAL" = true ]; then
pip install -e .[all]
else
pip install -e .
fi
fi
# Upgrade
# uv tool upgrade --all
# Run
# uv run main.py
# Copy .env.template to .env
if [ ! -f .env ]; then
cp .env.template .env
fi
# Create project directories
mkdir -p logs