-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetupProj.sh
More file actions
34 lines (33 loc) · 1.1 KB
/
SetupProj.sh
File metadata and controls
34 lines (33 loc) · 1.1 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
34
#! /bin/bash
# Check if UV is installed
#if [ ! -f "~/.local/bin/uv"]; then
if test -e "/usr/local/bin/uv" && [ "$(uname -s)" = "Linux" ] || [ "$(uname -p)" = "Darwin" ]; then
echo "UV is already installed, skipping step..."
else
# If not then install it
if curl -LsSf https://astral.sh/uv/install.sh | sh; then
echo "Installation succeeded"
elif wget -qO- https://astral.sh/uv/install.sh | sh; then
echo "Installation succeeded"
else
echo "Failed to install Astral"
fi
fi;
# Add the new path to PATH as it is not done on its own
export PATH="$HOME/.local/bin:$PATH"
# Now invoke it to create a venv
uv venv --python 3.11.6
# Activate the venv
source ./.venv/bin/activate
# Initialise project (create toml, etc), needed to create this template
uv init
# Make the venv install everything from requirements.txt
uv add -r requirements.txt
pre-commit install
python get_spec.py
# Patch to make sure pip is installed in the venv
python -m ensurepip --default-pip
# Deactivate venv to ensure pip install and reactivate
deactivate
source .venv/scripts/activate
pip install --upgrade pip