change pip to uv

This commit is contained in:
Bobby Bilali
2025-05-16 09:43:29 +02:00
parent f0973ccddd
commit e382bfd785
3 changed files with 16 additions and 25 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -33,25 +33,12 @@ function update_script() {
# Crawling the new version and checking whether an update is required
RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ "${RELEASE}" != "$(cat /opt/huntarr_version.txt 2>/dev/null)" ]] || [[ ! -f /opt/huntarr_version.txt ]]; then
if [[ "${RELEASE}" != "$(cat /opt/huntarr_version.txt)" ]] || [[ ! -f /opt/huntarr_version.txt ]]; then
# Stopping Services
msg_info "Stopping $APP"
systemctl stop huntarr
msg_ok "Stopped $APP"
# Update system dependencies
msg_info "Checking system dependencies"
$STD apt-get update
$STD apt-get install -y \
curl \
tar \
unzip \
jq \
python3 \
python3-pip \
python3-venv
msg_ok "System dependencies updated"
# Creating Backup - maintain only one backup file
msg_info "Creating Backup"
# Remove any existing backups
@ -79,14 +66,19 @@ function update_script() {
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
msg_info "Requirements have changed. Performing full upgrade."
/opt/huntarr/venv/bin/pip install --upgrade -r requirements.txt
uv pip install -r requirements.txt --virtual-env /opt/huntarr/venv
else
msg_info "Requirements unchanged. Verifying installation."
/opt/huntarr/venv/bin/pip install -r requirements.txt
uv pip install -r requirements.txt --virtual-env /opt/huntarr/venv
fi
else
# First time update
/opt/huntarr/venv/bin/pip install --upgrade -r requirements.txt
# First time update - ensure UV is installed
if ! command -v uv &> /dev/null; then
msg_info "Installing UV package manager"
curl -LsSf https://astral.sh/uv/install.sh | sh
msg_ok "UV package manager installed"
fi
uv pip install -r requirements.txt --virtual-env /opt/huntarr/venv
fi
# Store new checksum
md5sum requirements.txt | awk '{print $1}' >.requirements_checksum

View File

@ -19,15 +19,15 @@ REPO_NAME="Huntarr.io"
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
tar \
unzip \
jq \
python3 \
python3-pip \
python3-venv
msg_ok "Installed System Dependencies"
msg_info "Setting up UV package installer"
curl -LsSf https://astral.sh/uv/install.sh | sh
msg_ok "UV package installer set up"
msg_info "Setup ${APPLICATION}"
RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL -o "${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip"
@ -38,12 +38,11 @@ echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Setup ${APPLICATION}"
msg_info "Setting up Python Environment"
$STD python3 -m venv /opt/${APPLICATION}/venv
$STD uv venv /opt/${APPLICATION}/venv
msg_ok "Created Python Virtual Environment"
msg_info "Installing Python Dependencies"
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
$STD /opt/${APPLICATION}/venv/bin/pip install -r /opt/${APPLICATION}/requirements.txt
$STD uv pip install -r /opt/${APPLICATION}/requirements.txt --virtual-env /opt/${APPLICATION}/venv
msg_ok "Installed Python Dependencies"
msg_info "Creating Service"