Skip to content

chore: Prepare the 0.7.0 release - #197

Merged
slatecipher merged 1 commit into
mainlinefrom
chore/release-0.7.0
Dec 3, 2026
Merged

slatecipher merged 1 commit into
mainlinefrom
chore/release-0.7.0

Conversation

@slatecipher

Copy link
Copy Markdown
Owner

Prepares the 0.7.0 release, opened by make release-pr: [Unreleased] has Added, Changed and Removed, so it's a minor version.

Changes

  • version in pyproject.toml goes from 0.6.1 to 0.7.0.
  • uv.lock changes only clientx's own version. It was locked with the latest uv, so its revision stays the same.
  • ## [Unreleased] in CHANGELOG.md becomes ## [0.7.0] - 2026-12-02, with a new, empty ## [Unreleased] above it, and the link references compare v0.7.0. If you merge on a later day, change the date to match.

What's in 0.7.0

Added

  • A pydantic serializer in a parameter's type runs, as in Annotated[Point, PlainSerializer(str, return_type=str), Query()]. ClientX checks what a type dumps to, from pydantic's serialization schema, so a type of your own that dumps to text or a number can go in the query string, a header or a form. It used to raise DefinitionError. A type whose dumped form pydantic can't tell, such as a class of your own without a serializer, still raises.
  • A helper's default_factory works, with = None after it so type checkers see the argument as optional: tags: Annotated[list[str] | None, Json(default_factory=list)] = None sends [] when the caller leaves it out. A default inside a helper still raises: put it after =.
  • Pydantic's exclude_if on a helper leaves a value out of the request, as in Json(exclude_if=lambda value: value is None).

Changed

  • Every call's arguments are validated against their annotations, in pydantic's lax mode, before the request is built, and the request is built from the validated values. A helper's constraints, such as Query(ge=1), apply to every call, and an argument that doesn't fit raises ArgumentError, with pydantic's ValidationError as its cause, before anything is sent. A helper's strict=True, as in Query(strict=True), makes one parameter strict. Defaults aren't validated. Breaking:
    • A call that used to send an argument that doesn't fit its annotation now raises ArgumentError. For example, a str for a Sequence[str] parameter fails, as pydantic doesn't take a string as a sequence: annotate it str | Sequence[str] to take both.
    • Converted values are sent: 3 for a float parameter is sent as 3.0.
    • A model is sent as its annotated type, so a subclass's extra fields are left out. Annotate the parameter SerializeAsAny[Model] to send them.
    • A dict passed for a model is validated into the model, as the model reads one: by alias, and keys the model doesn't have are dropped. It used to be sent as it was. Set validate_by_name=True or extra="allow" in the model's model_config to take field names or keep other keys.
  • A File() or Body() parameter whose type holds a binary file, a stream or Any, such as BinaryIO, tuple[str, BinaryIO] or Iterator[bytes], needs pydantic's SkipValidation in its annotation, as in Annotated[BinaryIO, File(), SkipValidation]: pydantic can't validate a file or stream, so its value is passed on as it is, and the annotation says so. str, bytes, and file tuples and lists of them, such as tuple[str, bytes, str], are validated and need none. Breaking: one without it raises DefinitionError when the class is defined. Add SkipValidation.
  • A parameter can't be named model_config, a name starting with _, or the name of a pydantic BaseModel attribute, such as json, as each call's arguments are validated with a pydantic model of them. Breaking: one of those names raises DefinitionError when the class is defined. Rename the parameter, and give its helper alias= to send the old name.
  • A parameter typed as a Pydantic secret, SecretStr, SecretBytes or Secret[...], raises DefinitionError when the class is defined. Pydantic dumps one as **********, so the API got the stars: a Json() secret used to be sent that way without a word. Breaking: pass credentials with the client's auth=, or annotate the parameter str to send the value.
  • A Send option on a helper it doesn't apply to, such as embed on a Query(), is ignored, as pydantic ignores metadata it doesn't use. It used to raise DefinitionError.
  • A tool validates a model's arguments with a pydantic model of the parameters: an endpoint's tool with the same model as a call, and a @tool method's with one of its own. An argument the method doesn't have is reported as Extra inputs are not permitted, rather than Unexpected keyword argument. Breaking: a @tool method's parameter can't be named model_config, start with _, or have the name of a BaseModel attribute, such as json, as for an endpoint: one raises DefinitionError when the method is decorated. Rename it.

Removed

  • validate_arguments=True on ClientX and AsyncClientX: every call is validated now. Breaking: passing it raises a TypeError. Leave it out.
  • Send's exclude_unset, exclude_none and exclude_defaults. Send keeps embed and json_part. Breaking: an endpoint that sets one raises a TypeError when its module is imported. A model's own fields are dumped as the model defines them, and pydantic's exclude_if on the helper leaves out a value, as in Json(exclude_if=lambda value: value is None). A parameter with a default of None is still left out when the caller doesn't pass it.

After merging

Publish the draft release v0.7.0, on GitHub or with gh release edit v0.7.0 --draft=false, right after merging: it tags v0.7.0 on mainline. The Release workflow checks that the tag matches the project version, builds and smoke-tests the package, publishes it to TestPyPI, and waits for your approval on the pypi environment before it publishes to PyPI.

If you change the changelog here, update the draft's notes before publishing: uv run python scripts/release.py notes 0.7.0 | gh release edit v0.7.0 --notes-file -.

- Set `version` to 0.7.0: `[Unreleased]` has Added, Changed and Removed, so it's a minor version.
- Relock with the latest uv; only clientx's own version changes.
- Date the changelog's `[Unreleased]` section as `[0.7.0] - 2026-12-02`
  and add its compare link.
@slatecipher slatecipher added maintenance Tooling, configuration, and other upkeep release Release preparation and publishing labels Dec 3, 2026
@slatecipher slatecipher self-assigned this Dec 3, 2026
@slatecipher
slatecipher merged commit 2d24e1a into mainline Dec 3, 2026
8 checks passed
@slatecipher
slatecipher deleted the chore/release-0.7.0 branch December 3, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Tooling, configuration, and other upkeep release Release preparation and publishing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant