From dee63410ecbaf93f80600c965dbb938f169cbd70 Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Tue, 2 Jun 2026 13:04:40 +1200 Subject: [PATCH 1/2] chore: release 0.17.5 Bump all workspace crates and the Python runtime to 0.17.5 and promote the Unreleased CHANGELOG section. Includes the #161 namespace/root leaf-name collision fix (#162). --- CHANGELOG.md | 2 +- Cargo.lock | 8 ++++---- reflectapi-cli/Cargo.toml | 4 ++-- reflectapi-derive/Cargo.toml | 4 ++-- reflectapi-python-runtime/pyproject.toml | 2 +- .../src/reflectapi_runtime/__init__.py | 2 +- reflectapi-schema/Cargo.toml | 2 +- reflectapi/Cargo.toml | 6 +++--- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eae24c05..43c81c24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 0.17.5 Python client generation improvements: diff --git a/Cargo.lock b/Cargo.lock index 0275d6cd..f1776beb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1692,7 +1692,7 @@ dependencies = [ [[package]] name = "reflectapi" -version = "0.17.4" +version = "0.17.5" dependencies = [ "anyhow", "axum", @@ -1721,7 +1721,7 @@ dependencies = [ [[package]] name = "reflectapi-cli" -version = "0.17.4" +version = "0.17.5" dependencies = [ "anyhow", "clap", @@ -1785,7 +1785,7 @@ dependencies = [ [[package]] name = "reflectapi-derive" -version = "0.17.4" +version = "0.17.5" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1797,7 +1797,7 @@ dependencies = [ [[package]] name = "reflectapi-schema" -version = "0.17.4" +version = "0.17.5" dependencies = [ "glob", "serde", diff --git a/reflectapi-cli/Cargo.toml b/reflectapi-cli/Cargo.toml index aecccc30..1883bf56 100644 --- a/reflectapi-cli/Cargo.toml +++ b/reflectapi-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reflectapi-cli" -version = "0.17.4" +version = "0.17.5" edition = "2021" default-run = "reflectapi" @@ -23,7 +23,7 @@ doc = false workspace = true [dependencies] -reflectapi = { path = "../reflectapi", version = "0.17.4", features = ["codegen"] } +reflectapi = { path = "../reflectapi", version = "0.17.5", features = ["codegen"] } rouille = "3" clap = { version = "4.5.3", features = ["derive"] } diff --git a/reflectapi-derive/Cargo.toml b/reflectapi-derive/Cargo.toml index 47751d29..272ee13b 100644 --- a/reflectapi-derive/Cargo.toml +++ b/reflectapi-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reflectapi-derive" -version = "0.17.4" +version = "0.17.5" edition = "2021" license = "Apache-2.0" @@ -22,7 +22,7 @@ workspace = true proc-macro = true [dependencies] -reflectapi-schema = { path = '../reflectapi-schema', version = "0.17.4" } +reflectapi-schema = { path = '../reflectapi-schema', version = "0.17.5" } proc-macro2 = "1.0" quote = "1.0" diff --git a/reflectapi-python-runtime/pyproject.toml b/reflectapi-python-runtime/pyproject.toml index 4936fe1c..262c8576 100644 --- a/reflectapi-python-runtime/pyproject.toml +++ b/reflectapi-python-runtime/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "reflectapi-runtime" -version = "0.17.4" +version = "0.17.5" description = "Runtime library for ReflectAPI Python clients" readme = "README.md" requires-python = ">=3.12" diff --git a/reflectapi-python-runtime/src/reflectapi_runtime/__init__.py b/reflectapi-python-runtime/src/reflectapi_runtime/__init__.py index 4acf2d5f..6cc0ba78 100644 --- a/reflectapi-python-runtime/src/reflectapi_runtime/__init__.py +++ b/reflectapi-python-runtime/src/reflectapi_runtime/__init__.py @@ -50,7 +50,7 @@ ) from .types import BatchResult, ReflectapiEmpty, ReflectapiInfallible -__version__ = "0.17.4" +__version__ = "0.17.5" __all__ = [ # Authentication diff --git a/reflectapi-schema/Cargo.toml b/reflectapi-schema/Cargo.toml index 4d5aa364..8843ed4e 100644 --- a/reflectapi-schema/Cargo.toml +++ b/reflectapi-schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reflectapi-schema" -version = "0.17.4" +version = "0.17.5" edition = "2021" license = "Apache-2.0" diff --git a/reflectapi/Cargo.toml b/reflectapi/Cargo.toml index 76a47281..6cdb2572 100644 --- a/reflectapi/Cargo.toml +++ b/reflectapi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reflectapi" -version = "0.17.4" +version = "0.17.5" edition = "2021" license = "Apache-2.0" @@ -20,8 +20,8 @@ workspace = true [dependencies] # workspace dependencies -reflectapi-derive = { path = "../reflectapi-derive", version = "0.17.4" } -reflectapi-schema = { path = "../reflectapi-schema", version = "0.17.4" } +reflectapi-derive = { path = "../reflectapi-derive", version = "0.17.5" } +reflectapi-schema = { path = "../reflectapi-schema", version = "0.17.5" } # mandatory 3rd party dependencies serde = { version = "1.0.197", features = ["derive"] } From b0f90b27c79105a35293ffb48adac3773bd30a7a Mon Sep 17 00:00:00 2001 From: Brian Thorne Date: Tue, 2 Jun 2026 13:13:52 +1200 Subject: [PATCH 2/2] docs(changelog): make 0.17.5 notes user-facing Rewrite the namespace collision entry from codegen internals to the user-visible symptom and fix, and note that formatter failures now surface the formatter's own exit status and output. --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43c81c24..b53fdc86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,11 @@ Python client generation improvements: -- Python codegen still falls back to basic formatting when Ruff is not installed, but now reports an error if `ruff format` is available and fails; pass `--format=false` to skip external formatting. +- Python codegen still falls back to basic formatting when Ruff is not installed, but now reports a clear error — including the formatter's own exit status and output — if `ruff format` is available and fails; pass `--format=false` to skip external formatting. - Multi-field Rust tuple structs now generate valid Python `RootModel[tuple[...]]` models instead of invalid numeric field names. - Generated Python clients with nested namespaces now import cleanly when models refer to parent or sibling namespaces, including cases like `offer_rules.InsurerCategory`. - Namespace names containing characters that are not valid in Python identifiers, such as dashes or leading digits, now generate valid Python classes. -- A root type and a same-leaf type under a sub-namespace (e.g. `IfConflictOnUpdate` and `nomatches::IfConflictOnUpdate`) no longer collide on a bare public name. Previously each namespace re-emitted a ` = ` alias that shadowed the `from .._types import ` it also imported, so `_types.` and `.` resolved to two different classes and field annotations silently bound to the wrong one (pydantic then rejected values with a confusingly self-identical error). The namespace-local type now keeps its disambiguated name (`NomatchesIfConflictOnUpdate`) and references resolve to a single class per logical type. +- Fixed generated clients silently using the wrong class when a sub-namespace defined a type whose name matched a top-level type (e.g. a top-level `IfConflictOnUpdate` and a `nomatches::IfConflictOnUpdate`). The two were emitted as separate classes sharing one name, so a value built with one was rejected by the other at runtime with a confusingly self-identical pydantic validation error. Each logical type now resolves to a single class: when names would clash, the sub-namespace type is exposed under a namespace-qualified name (e.g. `nomatches.NomatchesIfConflictOnUpdate`) while the short name (`nomatches.IfConflictOnUpdate`) refers to the top-level type. - Schemas with a root namespace named `sys` no longer conflict with Python's standard `sys` module. - Re-running `reflectapi codegen` into an existing output directory now removes generated files from older schemas while preserving hand-written files.