From 0f5571901fce02d62eb368ec5718e23979e6e929 Mon Sep 17 00:00:00 2001 From: bilulib Date: Mon, 21 Jul 2025 15:00:34 +0200 Subject: [PATCH] try pip install fix --- ct/profilarr.sh | 20 +++++++++++++++----- install/profilarr-install.sh | 12 +++++++++++- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ct/profilarr.sh b/ct/profilarr.sh index 3748f41..fd89e1f 100644 --- a/ct/profilarr.sh +++ b/ct/profilarr.sh @@ -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 diff --git a/install/profilarr-install.sh b/install/profilarr-install.sh index 308a574..0e8bd38 100644 --- a/install/profilarr-install.sh +++ b/install/profilarr-install.sh @@ -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"