Spoolman: move to uv (#11121)

This commit is contained in:
Chris
2026-01-24 10:29:46 -05:00
committed by GitHub
parent 0828068d39
commit 4b3f7f688c
2 changed files with 12 additions and 13 deletions

View File

@@ -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"

View File

@@ -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 <<EOF >/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