Skip to content

Phase 1: convert cosmic-fastapi into a Copier template#26

Merged
tomasanchez merged 2 commits into
mainfrom
feat/copier-template
Jun 12, 2026
Merged

Phase 1: convert cosmic-fastapi into a Copier template#26
tomasanchez merged 2 commits into
mainfrom
feat/copier-template

Conversation

@tomasanchez

Copy link
Copy Markdown
Owner

Phase 1 — Convert cosmic-fastapi into a Copier template

First slice of the conversion epic #24. The repository is now a working Copier template, validated end-to-end by a bake-and-test that renders the template and runs the generated project's full quality gate.

What changed

  • ADR 0015 records the Copier-over-cookiecutter decision (native copier update, Jinja in contents+paths, typed questions).
  • copier.yml defines the questions: project_name, project_slug, package_name, identity (author_*, github_owner, license), python_version, database_url, and include_user_example; a post-copy uv lock task.
  • The generated project moved under template/ (Copier _subdirectory); the package was renamed template{{ package_name }} and identity/Python-version/license/DB defaults were templatized across 62 .jinja files (pyproject, Dockerfile, compose, CI, settings, migrations, README, LICENSE). GitHub Actions ${{ }} expressions are wrapped in {% raw %}.
  • Root template-authoring project with a bake-and-test harness (tests/test_bake.py) and Template CI that render the template and assert the generated suite passes Ruff + Pyrefly + pytest at 100% coverage.
  • Author-facing root README.md, .gitignore, and .pre-commit-config.yaml.

Validation

Independently baked with default/sample answers → generated project: uv sync ✅, ruff check ✅, pyrefly check ✅, 53 tests, 100% coverage ✅.

Deferred (tracked, not in this PR)

Closes #20
Refs #22, #24

🤖 Generated with Claude Code

tomasanchez and others added 2 commits June 12, 2026 17:51
Begin Phase 1 of the cookiecutter conversion (epic #24): document the Copier-over-cookiecutter decision and define the template questions, _subdirectory layout, and post-copy uv lock task.

Refs #24, #20

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Move the generated project under template/ (Copier _subdirectory), rename the package to {{ package_name }}, and templatize identity, Python version, license, and database defaults across pyproject, Dockerfile, docker-compose, CI, settings, migrations, and README (62 .jinja files). Add a root template-authoring project with a bake-and-test harness that renders the template and runs the generated suite (Ruff, Pyrefly, pytest at 100% coverage) plus template CI, and an author-facing README.

The User example slice stays included; the include_user_example false path is deferred to #21, and author-vs-generated doc cleanup to #23.

Closes #20

Refs #22, #24

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomasanchez tomasanchez merged commit e2ab4f9 into main Jun 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(template): introduce {{ project_slug }} wrapper layout and copier.yml

1 participant