Repository navigation
[FEAT, TEMPLATE, DOCS] v2.0.0 stage 2: option catalog, generation API, dev dependency split - #95
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
✅ Template Inspection Passed All changed templates have been validated successfully. Last updated: 2026-12-02T06:42:30.313Z |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requesting Merging
Description
Second staged PR for v2.0.0. It adds the two pieces the later stages build on, and keeps the CLI's prompts, tables and messages unchanged apart from the points under "Visible changes":
src/fastapi_fastkit/catalog/catalog.tomlwith loader, rules, i18n overlay and JSON export) as the single source of levels, templates, options, their dependencies and compatibility rules. The existing settings constants are derived from it.fastapi_fastkit.generation.generate(spec, target_dir), that does not prompt, run subprocesses, probe installed tools or print. The CLI now generates through it; environment creation and installation stay in the CLI layer.Stage 3 (unified
fastkit init) and stage 5 (web generator) use both.Type of Change
Test Environment
EncodingWarningfromfastapi_fastkitas errors: 4078 passed, 28 skippedLC_ALL=C,PYTHONUTF8=0),-m "not extended": 3987 passed, 28 skippedos/signalattributes removed): 4070 passed, 36 skippedmypy src,black --check,isort --check: cleanmkdocs build --strict: passesdev: 99%--interactive, five config files, four package managers, with--dry-run): terminal output and generated trees differ only in the points listed under "Visible changes" and inSECRET_KEYfastapi-sqlmodelDocker image built: no test or lint tools inside,/healthanswers/openapi.jsonof seven generated projects identical before and after thePage[T]changestartdemochecked by hand: success, forced failure (directory back to its original files, hashes and modes) and failed restore (backup kept, path printed)Not verified on real Windows, including the junction check (its test skips elsewhere). The security-scan workflow change was run locally only up to dependency resolution.
Major Changes
Catalog
catalog.tomlholds levels, presets, templates, package managers, option axes with runtime and dev dependencies, rules (requires, implies, adds, note) and a concept list with FastAPI docs URLs.python -m fastapi_fastkit.catalog exportwrites the JSON the web generator will read. Translation overlays (i18n/<lang>.toml) are supported; none ship yet.Generation API
GenerationSpeccovers template, stack and feature projects;spec_from_configmaps saved 1.x config files, keeping their pins, extras andversion.generatereturns the files written, the dependencies, the metadata and the messages the CLI then prints.plangives the same without writing;--dry-runuses it, and a test keeps its file list equal to what a real run writes.generatefor every template, preset and package manager withsubprocess,shutil.which,clickandrichoutput made to fail.Visible changes
fastkit initprojects: test and lint tools move from runtime dependencies to the dev group and a newrequirements-dev.txt. Generated Dockerfiles install runtime dependencies only; the generated Makefile, GitHub Actions workflow and devcontainer installrequirements-dev.txt. Every table that declares dev tools is kept equal, sopip install -e ".[dev]",uv sync,pdm installandpoetry installgive the same tools.fastapi-sqlmodel,fastapi-auth-jwt,fastapi-llm-agent:requirements-dev.txtadded; their images no longer contain test and lint tools.startdemodependency table and--dry-runlist show runtime dependencies, without comment lines or test tools.scripts/*.share executable after generation.--no-venv, output no longer depends on which package managers are installed. When the requested manager is missing and an environment is created, fastkit warns and sets the project up for an available one..envis never replaced; an existing.venvis not restored.addroutesorts the imports it writes the way isort does for any route name, and wraps an over-long inserted import. Registrations and imports underif TYPE_CHECKING:orif False:no longer count as present.PageandCRUDBaseuse the Python 3.12 type parameter syntax; projects created with the ruff option pass their ownruff check.Fixes
pkg @ https://...) were written as invalid TOML.fastapi-sqlmodel:mypy src testsis clean in a generated project; its lint script checks both.requirements-dev.txt-tpl.Docs
startdemooutput, overwrite behaviour, catalog step for new templates and options). Translations are not re-synced;reference/translation-statuslists the pages.Screenshots (optional)
N/A
Etc
addrouteoutput needs no formatter for route names up to 19 and entity names up to 18 characters (pinned by a test). Longer names give working code with sorted imports that black may rewrap.startdemocopies each template's ownrequirements.txt, which still lists dev tools for templates other than the three above; thesingle-modulepreset's generated project fails isort andmypy src; templates fail a bareruff checkon several rules.