From 4b3f7f688c61b07a8575f6ee14964746334c47ab Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 24 Jan 2026 10:29:46 -0500 Subject: [PATCH] Spoolman: move to uv (#11121) --- ct/spoolman.sh | 6 +++++- install/spoolman-install.sh | 19 +++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ct/spoolman.sh b/ct/spoolman.sh index 86013a351..239be0c45 100644 --- a/ct/spoolman.sh +++ b/ct/spoolman.sh @@ -28,6 +28,8 @@ function update_script() { exit fi + PYTHON_VERSION="3.14" setup_uv + if check_for_gh_release "spoolman" "Donkie/Spoolman"; then msg_info "Stopping Service" systemctl stop spoolman @@ -42,8 +44,10 @@ function update_script() { msg_info "Updating Spoolman" cd /opt/spoolman - $STD pip3 install -r requirements.txt + $STD uv sync --locked --no-install-project + $STD uv sync --locked cp /opt/spoolman_bak/.env /opt/spoolman + sed -i 's|^ExecStart=.*|ExecStart=/usr/bin/bash /opt/spoolman/scripts/start.sh|' /etc/systemd/system/spoolman.service msg_ok "Updated Spoolman" msg_info "Starting Service" diff --git a/install/spoolman-install.sh b/install/spoolman-install.sh index bb43e143c..c99d8887b 100644 --- a/install/spoolman-install.sh +++ b/install/spoolman-install.sh @@ -17,27 +17,22 @@ update_os msg_info "Installing Dependencies" $STD apt install -y \ build-essential \ - libpq-dev + libpq-dev \ + libffi-dev msg_ok "Installed Dependencies" -msg_info "Setting up Python3" -$STD apt install -y \ - python3-dev \ - python3-setuptools \ - python3-wheel \ - python3-pip -msg_ok "Setup Python3" - fetch_and_deploy_gh_release "spoolman" "Donkie/Spoolman" "prebuild" "latest" "/opt/spoolman" "spoolman.zip" +PYTHON_VERSION="3.14" setup_uv msg_info "Setting up Spoolman" cd /opt/spoolman -$STD pip3 install --upgrade --ignore-installed -r requirements.txt +$STD uv sync --locked --no-install-project +$STD uv sync --locked cp .env.example .env msg_ok "Setup Spoolman" msg_info "Creating Service" -cat <<'EOF' >/etc/systemd/system/spoolman.service +cat </etc/systemd/system/spoolman.service [Unit] Description=Spoolman After=network.target @@ -46,7 +41,7 @@ After=network.target Type=simple WorkingDirectory=/opt/spoolman EnvironmentFile=/opt/spoolman/.env -ExecStart=uvicorn spoolman.main:app --host "${SPOOLMAN_HOST}" --port "${SPOOLMAN_PORT}" +ExecStart=/usr/bin/bash /opt/spoolman/scripts/start.sh Restart=always User=root