try pip install fix
This commit is contained in:
@ -76,20 +76,30 @@ function update_script() {
|
|||||||
# Update Python dependencies
|
# Update Python dependencies
|
||||||
msg_info "Updating Python dependencies"
|
msg_info "Updating Python dependencies"
|
||||||
cd /opt/${APP}/backend || exit
|
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
|
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)
|
STORED_CHECKSUM=$(cat /opt/${APP}/.requirements_checksum)
|
||||||
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
|
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
|
||||||
msg_info "Requirements have changed. Performing full upgrade."
|
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
|
else
|
||||||
msg_info "Requirements unchanged. Verifying installation."
|
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
|
fi
|
||||||
else
|
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
|
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"
|
msg_ok "Updated Python dependencies"
|
||||||
|
|
||||||
# Build frontend
|
# Build frontend
|
||||||
|
|||||||
@ -63,8 +63,18 @@ $STD uv venv /opt/${APPLICATION}/venv
|
|||||||
|
|
||||||
# Install a compatible version of PyYAML first
|
# 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 "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
|
$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_ok "Setup ${APPLICATION}"
|
||||||
|
|
||||||
msg_info "Building Frontend"
|
msg_info "Building Frontend"
|
||||||
|
|||||||
Reference in New Issue
Block a user