feat: migrate backend to uv package manager

Replace pip + requirements.txt with uv for dependency management.

- Multi-stage Dockerfile using ghcr.io/astral-sh/uv builder image
- CI updated to use astral-sh/setup-uv@v4
- Ruff config moved to [tool.ruff.lint] (fixes deprecation)
- Transitive deps removed, missing direct deps added (requests, PySocks, urllib3)
- Database layer migrated to async (AsyncSession + aiosqlite)
- Tests updated to match async database interface

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
EstrellaXD
2026-01-23 12:56:23 +01:00
parent bfba010471
commit 9c5474d8e9
15 changed files with 2270 additions and 422 deletions

View File

@@ -13,20 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
- uses: astral-sh/setup-uv@v4
with:
python-version: '3.11'
version: "latest"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f backend/requirements.txt ]; then pip install -r backend/requirements.txt; fi
pip install pytest
run: cd backend && uv sync --group dev
- name: Test
working-directory: ./backend/src
run: |
mkdir -p config
pytest
mkdir -p backend/config
cd backend && uv run pytest src/test -v
webui-test:
runs-on: ubuntu-latest
@@ -295,10 +290,6 @@ jobs:
echo ${{ needs.version-info.outputs.version }}
echo "VERSION='${{ needs.version-info.outputs.version }}'" >> module/__version__.py
- name: Copy requirements.txt
working-directory: ./backend
run: cp requirements.txt src/requirements.txt
- name: Zip app
run: |
cd backend && zip -r app-v${{ needs.version-info.outputs.version }}.zip src