-
-
Notifications
You must be signed in to change notification settings - Fork 228
Description
Summary
The CI workflow in .github/workflows/tests.yml is misaligned with the current tooling configured in the template. This breaks all new project builds and causes false negatives in linting and formatting checks.
Problem Statement
The project has been modernized to use uv for dependency management and ruff for both linting & formatting (see .pre-commit-config.yaml and pyproject.toml).
-
Broken CI Workflow (
.github/workflows/tests.yml):- Still uses Poetry instead of uv.
- Attempts to run a black check that no longer exists.
- Runs on Python 3.11, but the project requires >=3.12.
-
Redundant Config (
pyproject.toml):- Contains a [tool.isort] section that conflicts with Ruff's built-in import sorting.
-
Outdated Migration Hooks (
alembic.ini):- The post-write hook still calls black to format new database migrations, not ruff.
Result:
- Lint checks fail with errors about missing hooks and misconfigured tooling (not due to code issues, but workflow errors).
- Projects generated from the template inherit a broken setup unless the workflow file is manually fixed after generation.
Evidence
- In
.pre-commit-config.yaml, defined hooks are:ruff-format,ruff,mypy— all run usinguv. - In
.github/workflows/tests.yml, matrix still includesblackand all commands run throughpoetry. Steps explicitly include installing Poetry and runningpoetry runcommands. - Template's
pyproject.tomlshows no use of Poetry; dependency management is handled by UV features and requires Python>=3.12. - alembic.ini: Explicitly configured to run black after creating a migration.
Suggested Resolution
-
Update the workflow:
- Replace Poetry install/setup/commands with
uvequivalents (astral-sh/setup-uvanduv sync). - Update the
python-versionfor all jobs to'3.12'. - Remove all
blackreferences from the matrix; useruff-format,ruff, andmypysteps only. - Delete the entire [tool.isort] section to remove the conflict with Ruff.
- Update the
pre-commitrun commands to invoke the correct hooks, e.g.,uv run pre-commit run -a <hook>. - Ensure the CI is consistent with the
.pre-commit-config.yamland actual project dependencies.
- Replace Poetry install/setup/commands with
-
(Optional) Expose as CLI Option: Consider prompting users at project setup to choose between UV and other managers (for future flexibility), and select preferred formatter (Ruff vs Black), ensuring generated workflows match that choice.
Impact
- Currently, CI pipelines fail for all new projects, potentially misleading contributors and reducing trust in the template automation.
- Maintaining outdated workflows increases onboarding friction and erodes DevOps best practices across downstream adopters.
References
Happy to submit a PR to address this and test proposed changes. Please assign this issue to me if accepted!
/cc @CynthiaWahome