Merge pull request 'try pip install fix' (#13) from profilarr-script into dev
Reviewed-on: #13
This commit is contained in:
@ -76,20 +76,30 @@ function update_script() {
|
||||
# Update Python dependencies
|
||||
msg_info "Updating Python dependencies"
|
||||
cd /opt/${APP}/backend || exit
|
||||
|
||||
# Create a temporary requirements file excluding the incompatible PyYAML version
|
||||
temp_req_file=$(mktemp)
|
||||
grep -v "^PyYAML" requirements.txt >"$temp_req_file"
|
||||
|
||||
if [[ -f "/opt/${APP}/.requirements_checksum" ]]; then
|
||||
CURRENT_CHECKSUM=$(md5sum requirements.txt | awk '{print $1}')
|
||||
CURRENT_CHECKSUM=$(md5sum "$temp_req_file" | awk '{print $1}')
|
||||
STORED_CHECKSUM=$(cat /opt/${APP}/.requirements_checksum)
|
||||
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
|
||||
msg_info "Requirements have changed. Performing full upgrade."
|
||||
$STD uv pip install -r requirements.txt --python /opt/${APP}/venv/bin/python
|
||||
# Ensure compatible PyYAML is installed
|
||||
$STD uv pip install --python /opt/${APP}/venv/bin/python "PyYAML>=6.0"
|
||||
$STD uv pip install -r "$temp_req_file" --python /opt/${APP}/venv/bin/python
|
||||
else
|
||||
msg_info "Requirements unchanged. Verifying installation."
|
||||
$STD uv pip install -r requirements.txt --python /opt/${APP}/venv/bin/python
|
||||
$STD uv pip install -r "$temp_req_file" --python /opt/${APP}/venv/bin/python
|
||||
fi
|
||||
else
|
||||
$STD uv pip install -r requirements.txt --python /opt/${APP}/venv/bin/python
|
||||
# Ensure compatible PyYAML is installed
|
||||
$STD uv pip install --python /opt/${APP}/venv/bin/python "PyYAML>=6.0"
|
||||
$STD uv pip install -r "$temp_req_file" --python /opt/${APP}/venv/bin/python
|
||||
fi
|
||||
md5sum requirements.txt | awk '{print $1}' >/opt/${APP}/.requirements_checksum
|
||||
md5sum "$temp_req_file" | awk '{print $1}' >/opt/${APP}/.requirements_checksum
|
||||
rm -f "$temp_req_file"
|
||||
msg_ok "Updated Python dependencies"
|
||||
|
||||
# Build frontend
|
||||
|
||||
@ -63,8 +63,18 @@ $STD uv venv /opt/${APPLICATION}/venv
|
||||
|
||||
# Install a compatible version of PyYAML first
|
||||
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python "PyYAML>=6.0"
|
||||
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python -r /opt/${APPLICATION}/backend/requirements.txt
|
||||
|
||||
# Create a temporary requirements file excluding the incompatible PyYAML version
|
||||
temp_req_file=$(mktemp)
|
||||
grep -v "^PyYAML" /opt/${APPLICATION}/backend/requirements.txt >"$temp_req_file"
|
||||
|
||||
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python -r "$temp_req_file"
|
||||
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python gunicorn
|
||||
|
||||
# Store the modified requirements checksum for future updates
|
||||
md5sum "$temp_req_file" | awk '{print $1}' >/opt/${APPLICATION}/.requirements_checksum
|
||||
|
||||
rm -f "$temp_req_file"
|
||||
msg_ok "Setup ${APPLICATION}"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
|
||||
Reference in New Issue
Block a user