Backend runtime upgraded to Python 3.14 with exact dependency pinning (#57)
Some checks failed
CICD Start / Sanity and Base Decision (push) Successful in 18s
Runner Canary / Canary Heavy (ubuntu-act-8gb) (push) Has been skipped
Runner Canary / Canary Heavy (ubuntu-act-4gb) (push) Has been skipped
Runner Canary / Canary Burst (ubuntu-act (push) Failing after 11m10s
Runner Canary / Canary (ubuntu-latest) (push) Failing after 12m39s
Runner Canary / Canary (ubuntu-act) (push) Failing after 12m42s

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>

## Summary

Upgrades backend runtime baseline and dependency management for issue #10.

### Changes

1. **Python Baseline**: Updated from 3.13 to 3.14
   - Updated `backend/pyproject.toml` requires-python constraint
   - Updated `backend/pyrightconfig.json` pythonVersion
   - Updated all Dockerfile and CI references

2. **Dependency Pinning**: Switched to exact version pins in `backend/pyproject.toml`
   - All dev and runtime dependencies now use `==` instead of `>=`
   - `fastapi==0.120.2`, `uvicorn==0.38.0`
   - ruff, pyright, pytest suite pinned to current resolved versions
   - Regenerated `backend/uv.lock` under Python 3.14

3. **Startup Compatibility Guard** (TDD via RED→GREEN)
   - New `compatibility_status()` function evaluates runtime and pinned deps
   - Startup raises `RuntimeError` if policy fails
   - Implemented via FastAPI lifespan (non-deprecated) handler

4. **Compatibility Status Endpoint**
   - New `GET /compatibility` returns policy status, runtime version, and package checks
   - Shares single source of truth with startup validation

5. **Integration Tests**
   - Added failing-then-passing tests for startup guard and endpoint behavior
   - 100% coverage maintained

6. **Direnv Configuration**
   - Added `UV_PYTHON="3.14"` pin to repo `.envrc`
   - Ensures direnv creates/recreates venv with correct Python version

### Validation

-  ruff format/check
-  pyright strict (0 errors)
-  pytest: 8 passed, 100% coverage (>=95 gate)
-  pydoclint: pass
-  xdoctest: pass

### Notes

- SQLAlchemy/SQLModel introduction deferred to next pass per scope
- Compatibility logic currently validates fastapi/uvicorn pins (runtime deps)
- Ready for container build validation and Renovate bot testing

Co-authored-by: copilotcoder <copilotcoder@darkhelm.org>
Reviewed-on: #57
Co-authored-by: Cliff Hill <xlorep@darkhelm.org>
Co-committed-by: Cliff Hill <xlorep@darkhelm.org>
This commit was merged in pull request #57.
This commit is contained in:
2026-06-18 11:19:24 -04:00
committed by Xlorep DarkHelm
parent 5d74dd8d8f
commit d02039a22e
52 changed files with 4480 additions and 966 deletions

View File

@@ -4,23 +4,23 @@ requires = ["hatchling"]
[dependency-groups]
dev = [
"ruff>=0.6.0",
"pyright>=1.1.380",
"pydoclint>=0.3.8",
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-cov>=4.1.0",
"typeguard>=4.1.0",
"httpx>=0.25.0", # For testing async HTTP calls
"pytest-mock>=3.12.0",
"ruff==0.14.1",
"pyright==1.1.406",
"pydoclint==0.8.3",
"pytest==8.4.2",
"pytest-asyncio==1.2.0",
"pytest-cov==7.0.0",
"typeguard==4.4.4",
"httpx==0.28.1", # For testing async HTTP calls
"pytest-mock==3.15.1",
# File format and linting tools
"pre-commit>=3.0.0", # For running pre-commit hooks in CI
"pyyaml>=6.0",
"yamllint>=1.35.0",
"toml-sort>=0.23.0",
"language-formatters-pre-commit-hooks>=2.14.0", # For pretty-format-toml
"xdoctest>=1.1.0", # For doctest support
"poethepoet>=0.24.0" # Task runner for unified development workflows
"pre-commit==4.3.0", # For running pre-commit hooks in CI
"pyyaml==6.0.3",
"yamllint==1.37.1",
"toml-sort==0.24.3",
"language-formatters-pre-commit-hooks==2.15.0", # For pretty-format-toml
"xdoctest==1.3.0", # For doctest support
"poethepoet==0.41.0" # Task runner for unified development workflows
]
[project]
@@ -30,18 +30,18 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13"
"Programming Language :: Python :: 3.14"
]
dependencies = [
"fastapi>=0.100.0",
"uvicorn>=0.22.0"
"fastapi==0.120.2",
"uvicorn==0.38.0"
]
description = "Backend service for Plex playlist management"
keywords = ["plex", "playlist", "media", "management"]
license = "MIT"
name = "plex-playlist-backend"
readme = "../README.md"
requires-python = ">=3.13"
requires-python = ">=3.14"
version = "0.1.0"
[tool.coverage]
@@ -133,9 +133,9 @@ lint-frontend = {shell = "cd frontend && yarn lint", help = "Lint frontend TypeS
# === Parallel Execution for Speed ===
lint-parallel = {shell = "poe lint-backend & poe lint-frontend & wait", help = "Run linting in parallel for speed"}
# === CI/CD Tasks ===
pre-commit-install = {shell = "pre-commit install", help = "Install pre-commit hooks"}
pre-commit-run = {shell = "pre-commit run --all-files", help = "Run all pre-commit hooks"}
pre-commit-update = {shell = "pre-commit autoupdate", help = "Update pre-commit hook versions"}
pre-commit-install = {shell = "pre-commit install --config ../.pre-commit-config.yaml", help = "Install pre-commit hooks"}
pre-commit-run = {shell = "pre-commit run --all-files --config ../.pre-commit-config.yaml", help = "Run all pre-commit hooks"}
pre-commit-update = {shell = "pre-commit autoupdate --config ../.pre-commit-config.yaml", help = "Update pre-commit hook versions"}
# === Quality Gates (Mimics CI Pipeline) ===
quality-gate = [
{shell = "echo '🔍 Running quality gate checks...'"},
@@ -212,7 +212,7 @@ testpaths = ["tests"]
[tool.ruff]
line-length = 88
src = ["src"]
target-version = "py313"
target-version = "py314"
[tool.ruff.lint]
ignore = [