-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·30 lines (24 loc) · 972 Bytes
/
setup.sh
File metadata and controls
executable file
·30 lines (24 loc) · 972 Bytes
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
#!/bin/bash
# Define your Python version and environment name
PYTHON_VERSION=3.12
ENV_NAME=venv
# Check if desired Python version is installed
if ! command -v python$PYTHON_VERSION &> /dev/null
then
echo "Python version $PYTHON_VERSION could not be found, please install it first"
exit
fi
# Create a new virtualenv
echo "Creating new virtual environment..."
uv venv
# Activate the virtualenv
echo "Activating the virtual environment..."
source .venv/bin/activate
# Install the packages from requirements.lock
echo "Installing packages..."
if [ ! -f "requirements.lock" ] || [ "requirements.txt" -nt "requirements.lock" ]; then
echo "Compiling requirements.lock..."
uv pip compile requirements.txt -o requirements.lock --index-url https://artifactory.global.square/artifactory/api/pypi/block-pypi/simple
fi
uv pip install -r requirements.lock --index-url https://artifactory.global.square/artifactory/api/pypi/block-pypi/simple
echo "Setup complete!"