Repository navigation
Tags
Tags
Make the TypeVar namespace error name the same models on every run (#636 ) When a generic used without type args and the models nested in it share a type parameter, Cadwyn picked one of those models to resolve the parameter's quoted bound, constraints, or default. That choice changed validation, not just the error message. With `Outer.item: T`, `Outer.node: Node[T]`, and `T` bound to `"Node"`, picking `Node` kept `T` as it was, so the older `Outer` validated the latest `Node`: the old shape got a 422 and the latest-only shape passed silently. Which model got picked depended on set order. Sorting the models by module and qualname, as this PR first did, still left classes from the same factory in arbitrary order and crashed on a `None` module. Cadwyn keeps a parameter as it is when its fallback refers back to the model that uses it, because pydantic resolves a quoted reference to a model to that model's copy. But it does that only within that copy itself, and only for that model's own name. Now the parameter stays as it is only if a single model's fields use it and its fallback names no other model that changes in that version; otherwise Cadwyn versions it, or fails at startup as main does. For example, with `T` bound to `Union["A", "B"]` and used by both `A` and `B`, the copy of `A` would resolve `"B"` to the latest `B`, so this fails at startup. All of those models must resolve the fallback to the same classes (Cadwyn fails at startup otherwise), so any of them can resolve it: Cadwyn takes the generic itself if it uses the parameter, or else its first nested model in field order, without sorting. The startup error names the generic and lists the models in that order, with the generic first. Tests cover both owner orders, factory classes with the same module and qualname, a nested model whose `__module__` is `None`, and a bound or constraints that name both models using the parameter, in both field orders. A parameter used only by a nested model and bound to the outer generic, such as `inner: Inner[T]` with `T` bound to `"Page"` in `Page`, fails at startup again instead of keeping `T`. This error was added during 9.0.0 development, so it needs no CHANGELOG entry. Refs #584. Created with Claude Opus 5.5 in T3 Code.
Prepare 8.2.0 release (#542) Bumps the version to 8.2.0 and moves the unreleased CHANGELOG entries under it. The release has one possibly breaking change (#496: override form fields that accept any value now get their own value), plus fixes for form models on FastAPI 0.158.2+ (#495, #496, #529), unions of form models, `Json[...]` fields (#523), Flag enums (#522), recursive type aliases (#524), the `cadwyn` command, and the documentation (every example is now tested). Also points the #523 entry's link to Known limitations at the release docs instead of `/dev/`. Doesn't publish anything: PyPI publishing only runs when a GitHub release is created.
Prepare 8.1.1 release (#504) Bumps the version to 8.1.1 and moves the unreleased CHANGELOG entries under it: the fix for docs dashboard links that repeated the root path (#501, #503) and the per-release documentation versions (#499). Doesn't publish anything: PyPI publishing only runs when a GitHub release is created.
Prepare 8.1.0 release (#498) Bumps the version to 8.1.0 and moves the unreleased CHANGELOG entries under it: the fix for form-model endpoints on FastAPI 0.159+ (#497), the startup warnings for alias instructions that keep the field's old key (#492), and the design-decisions docs. Doesn't publish anything: PyPI publishing only runs when a GitHub release is created.
Shorten the 8.0.0 changelog (#483) Rewrites the 8.0.0 section of CHANGELOG.md from about 5,300 words to about 1,070. Each bullet now states the change in one or two sentences and links to the docs for the details: generic models, inherited fields, versioned dependencies, and self-referencing models. Related fixes are grouped into sub-lists. No code changes.
Prepare 7.1.2 CI compatibility release (#401) ## Summary - restore compatibility across FastAPI versions that do and do not retain `_flat_dependant` - add regression coverage for both route shapes - replace the invalid inline Ruff formatter suppression with a valid block suppression - prepare the changelog and package metadata for Cadwyn 7.1.2 ## Root cause FastAPI 0.140.2 stopped retaining flattened dependency trees, and ty 0.0.64 correctly rejected Cadwyn's direct access to the now-absent private attribute. The current `main` SHA also used a formatter suppression that newer Ruff rejects inside an expression. ## Impact Scheduled dependency-refresh CI can run against current FastAPI and ty releases while Cadwyn remains compatible with its minimum supported FastAPI version. The release metadata is ready for 7.1.2 publication after this PR is green and merged. ## Validation - `make check` - Python 3.10, 3.11, 3.12, 3.13, and 3.14 test environments - 100% combined coverage - lint, docs, links, tutorial, and build - focused copy-route tests against FastAPI 0.137.1
PreviousNext