From 87330a3dcc693c25c28d1698791c67a23972b9de Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Fri, 17 Jul 2026 02:25:16 -0300 Subject: [PATCH 1/2] ci: add cross-platform scaffold smoke Co-authored-by: Cursor --- .github/workflows/scaffold-cross-platform.yml | 92 +++++++++++++++++++ docs/CPA_TEMPLATES_TRACKING.md | 3 +- 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/scaffold-cross-platform.yml diff --git a/.github/workflows/scaffold-cross-platform.yml b/.github/workflows/scaffold-cross-platform.yml new file mode 100644 index 0000000..bee7abf --- /dev/null +++ b/.github/workflows/scaffold-cross-platform.yml @@ -0,0 +1,92 @@ +name: Cross-platform scaffold smoke + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: scaffold-cross-platform-${{ github.ref }} + cancel-in-progress: true + +jobs: + scaffold: + name: ${{ matrix.os }} / fastapi-starter + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: astral-sh/setup-uv@v7 + - uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Scaffold FastAPI starter from PyPI CLI + env: + TARGET: ${{ runner.temp }}/cpa-fastapi-starter + shell: bash + run: | + set -euo pipefail + uvx create-awesome-python-app@latest "$TARGET" \ + --template fastapi-starter \ + --no-interactive \ + --no-install \ + --force + + - name: Verify scaffolded project + env: + TARGET: ${{ runner.temp }}/cpa-fastapi-starter + shell: bash + run: | + set -euo pipefail + python - <<'PY' + import os + from pathlib import Path + + target = Path(os.environ["TARGET"]) + required = [ + target / "pyproject.toml", + target / "app" / "main.py", + target / "README.md", + ] + missing = [str(path) for path in required if not path.exists()] + if missing: + raise SystemExit(f"Missing scaffolded files: {missing}") + print(f"Verified scaffold at {target}") + PY + + addon-smoke: + name: ubuntu-latest / fastapi-starter + python-docker + runs-on: ubuntu-latest + steps: + - uses: astral-sh/setup-uv@v7 + - uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Scaffold with one extension from PyPI CLI + env: + TARGET: ${{ runner.temp }}/cpa-fastapi-docker + run: | + set -euo pipefail + uvx create-awesome-python-app@latest "$TARGET" \ + --template fastapi-starter \ + --addons python-docker \ + --no-interactive \ + --no-install \ + --force + + - name: Verify extension files + env: + TARGET: ${{ runner.temp }}/cpa-fastapi-docker + run: | + set -euo pipefail + test -f "$TARGET/Dockerfile" + test -f "$TARGET/.dockerignore" diff --git a/docs/CPA_TEMPLATES_TRACKING.md b/docs/CPA_TEMPLATES_TRACKING.md index 9285345..be48c5b 100644 --- a/docs/CPA_TEMPLATES_TRACKING.md +++ b/docs/CPA_TEMPLATES_TRACKING.md @@ -31,7 +31,8 @@ uvx create-awesome-python-app@latest … It must **not** check out this monorepo or fall back to `uv run` against a local source tree. That way green Actions means the same binary users install works with the templates under test. -CLI CI in this repo stays focused on unit/lint/type/smoke-distribution (`uvx` / Docker / brew / AUR). +CLI CI in this repo stays focused on unit/lint/type, cross-platform scaffold +smoke via published `uvx`, and smoke-distribution (`uvx` / Docker / brew / AUR). ## CNA parity reference From 12746b728ab78fd7fed6dcb85b1521f1d6c3332b Mon Sep 17 00:00:00 2001 From: ulises-jeremias Date: Fri, 17 Jul 2026 04:10:17 -0300 Subject: [PATCH 2/2] fix(ci): use full template URLs and options-before-path for uvx smoke Published 0.1.0 does not resolve catalog slugs; Typer also misparses options when the project path comes first. Co-authored-by: Cursor --- .github/workflows/scaffold-cross-platform.yml | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/scaffold-cross-platform.yml b/.github/workflows/scaffold-cross-platform.yml index bee7abf..f209c34 100644 --- a/.github/workflows/scaffold-cross-platform.yml +++ b/.github/workflows/scaffold-cross-platform.yml @@ -14,6 +14,12 @@ concurrency: group: scaffold-cross-platform-${{ github.ref }} cancel-in-progress: true +env: + # Full registry URLs: published PyPI 0.1.0 does not resolve catalog slugs. + # After create-awesome-python-app>=0.2.0 ships resolve_catalog_spec, slugs also work. + CPA_TEMPLATE_FASTAPI: https://github.com/Create-Python-App/cpa-templates?subdir=templates/fastapi-starter + CPA_ADDON_DOCKER: https://github.com/Create-Python-App/cpa-templates?subdir=extensions/python-docker + jobs: scaffold: name: ${{ matrix.os }} / fastapi-starter @@ -34,11 +40,14 @@ jobs: shell: bash run: | set -euo pipefail - uvx create-awesome-python-app@latest "$TARGET" \ - --template fastapi-starter \ + # Options before project_directory — Typer treats a leading path as the + # positional arg; trailing options after a bare path can be misparsed. + uvx create-awesome-python-app@latest \ + --template "$CPA_TEMPLATE_FASTAPI" \ --no-interactive \ --no-install \ - --force + --force \ + "$TARGET" - name: Verify scaffolded project env: @@ -76,12 +85,13 @@ jobs: TARGET: ${{ runner.temp }}/cpa-fastapi-docker run: | set -euo pipefail - uvx create-awesome-python-app@latest "$TARGET" \ - --template fastapi-starter \ - --addons python-docker \ + uvx create-awesome-python-app@latest \ + --template "$CPA_TEMPLATE_FASTAPI" \ + --addons "$CPA_ADDON_DOCKER" \ --no-interactive \ --no-install \ - --force + --force \ + "$TARGET" - name: Verify extension files env: