**UV Integration:** - Updated pyproject.toml with [tool.uv.scripts] - Added 'uv run start' to launch wedding phone - Added 'uv run test' to run audio tests - Refactored main code into main() function - Added proper entry point for package installation **Systemd Service:** - Created wedding-phone.service template - Service runs with UV for dependency management - Automatic restart on failure - Proper security hardening (NoNewPrivileges, PrivateTmp) - GPIO and audio group access configured **Service Installer:** - Created install_service.sh automated installer - Auto-detects project path and user - Checks for UV installation and dependencies - Configures service file with correct paths - Option to enable and start immediately - Provides helpful command reference **Installer Features:** - Validates config.json exists (creates from example if missing) - Installs UV dependencies automatically - Updates service file paths dynamically - Color-coded output for clarity - Error checking at each step - Clean installation process **Usage:** ```bash # Run directly with UV uv run start # Install as system service ./install_service.sh # Service management sudo systemctl start wedding-phone sudo systemctl stop wedding-phone sudo journalctl -u wedding-phone -f ``` **Documentation:** - Updated README with UV commands - Added service installation guide - Removed old manual systemd instructions - Added service management commands - Updated file structure documentation **Benefits:** - Easier to run (single command) - Automatic startup on boot - Better dependency management - Professional service integration - Simplified installation process 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
640 B
TOML
33 lines
640 B
TOML
[project]
|
|
name = "wedding-phone"
|
|
version = "1.0.0"
|
|
description = "Vintage rotary phone audio system for weddings and events"
|
|
readme = "README.md"
|
|
requires-python = ">=3.7"
|
|
dependencies = [
|
|
"flask>=2.3.0",
|
|
"numpy>=1.21.0",
|
|
"pyaudio>=0.2.13",
|
|
"RPi.GPIO>=0.7.1",
|
|
]
|
|
|
|
[project.scripts]
|
|
wedding-phone = "rotary_phone_web:main"
|
|
wedding-phone-test = "test_complete:main"
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=7.0.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.uv]
|
|
dev-dependencies = []
|
|
|
|
[tool.uv.scripts]
|
|
start = "python rotary_phone_web.py"
|
|
test = "python test_complete.py"
|