Skip to content

python-uv: reusable lint, type check and per-package tests for uv workspaces #172

Open

Description

@swibrow

What

A reusable workflow for uv workspaces: lint once, then type checks and tests per workspace package in parallel, each with an optional Postgres service container.

Why it matters

DND-IT/tamedia-ai-platform runs ruff, mypy and pytest over the whole workspace in one job: 261s, 191s of it pytest over 2,143 tests, on any Python change, and every image build waits for it. Split per package, the run takes as long as the slowest package, and with tamci's change detection (DND-IT/tamci, workspace-aware change detection) only the affected packages run.

Suggested fix

python-uv.yaml with inputs: packages (JSON array of workspace member paths, e.g. from tamci config), python_version_file, postgres_image (empty for none) and the env var names that receive its URL, mypy and pytest toggles. Jobs: lint (ruff check, ruff format --check) once, then a matrix over packages running uv sync --locked --package <name>, mypy and pytest <path>/tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions