Skip to content

fix: widen pydantic-core bound via fern 5.14.8 regen (closes #701)#724

Merged
GregHolmes merged 4 commits into
mainfrom
gh/sdk-gen-2026-06-02
Jun 3, 2026
Merged

fix: widen pydantic-core bound via fern 5.14.8 regen (closes #701)#724
GregHolmes merged 4 commits into
mainfrom
gh/sdk-gen-2026-06-02

Conversation

@GregHolmes
Copy link
Copy Markdown
Contributor

@GregHolmes GregHolmes commented Jun 2, 2026

SDK regeneration for 2026-06-02.

Generator bump

fernapi/fern-python-sdk 5.8.3 → 5.14.8 (set in deepgram-docs/fern/generators.yml). SDK version 7.1.2 → 7.3.1.

Headline fix — closes #701, supersedes #723

The new generator widens the pydantic-core bound from >=2.18.2,<2.44.0 to >=2.18.2,<3.0.0 in both pyproject.toml and requirements.txt, and regenerates poetry.lock (now resolves pydantic-core 2.46.4). This fixes the resolver conflict with pydantic>=2.13 at the generator level, so the manual one-line patch in #723 is no longer needed.

Manual patches reconciled

All 20 temporarily-frozen files were diffed (.bak vs regenerated). The generator caught up on none of them, so all 20 patches were re-applied and re-frozen in .fernignore:

  • core/query_encoder.py — bool→lowercase coercion for websocket query strings
  • 4 socket clients — broad except Exception, optional control-message params, agent _sanitize_numeric_types, listen/v2 send_configure raw shim
  • 7 agent-settings type/request files — back-compat for the 2026-05-05 schema restructure (callable AgentV1SettingsAgent(...), legacy messages=/nested-context remap, .messages read access, str audio container). Note: 5.14.8 now natively types AgentV1SettingsAgent = Union[AgentV1SettingsAgentContext, str]; the callable-class shim is retained for constructor back-compat.
  • 7 package __init__.py files — legacy alias re-exports (no new generator entries to merge; all showed new+:0)
  • tests/wire/test_manage_v1_projects_keys.py — legacy create-key alias wire coverage

Verification

  • poetry run mypy src/ — clean (801 files)
  • poetry run pytest -rP . — 222 passed, 4 skipped (incl. all custom back-compat regression tests)
  • Pre-existing ruff findings in tests/manual/tests/custom are unchanged and not CI-gated.

@GregHolmes GregHolmes changed the title chore: SDK regeneration 2026-06-02 fix: widen pydantic-core bound via fern 5.14.8 regen (closes #701) Jun 2, 2026
@GregHolmes
Copy link
Copy Markdown
Contributor Author

Breaking-change review (7.3.0 → this branch)

Verdict: no breaking changes for consumers. The only net consumer-visible gain is the additive max_retries client parameter.

Scope

The net src/deepgram diff vs 7.3.0 is 9 files — the 20 frozen files were restored to their exact 7.3.0 content, so all generator restructuring (e.g. AgentV1SettingsAgent→Union, audio.output.container str→enum, socket-client narrowing) is neutralized by the compat shims and never reaches consumers. Also verified: no source files added/removed/renamed, no public exports changed (frozen __init__.py), no REST/WebSocket method signatures changed.

The 9 changed files

File Change Verdict
base_client.py new optional max_retries (default 2) Additive; DeepgramClient(*args, **kwargs) forwards it
client_wrapper.py plumb max_retries, get_max_retries(), UA version bump Additive; default 2 = prior HttpClient default → no retry-behavior change
http_client.py _should_retry inlined Cosmetic
unchecked_base_model.py guard bare list/dict/set annotations Strictly safer (prevents IndexError)
pydantic_utilities.py parse_sse_obj simplified; TypeAdapter cache SSE is dead code for Deepgram; cache is behavior-equivalent
serialization.py type-hint cache + conversion short-circuit Verified correct at runtime (alias detection + dealias round-trip)
manage/.../keys/raw_client.py drop redundant content-type header httpx sets it from json= → no wire change
requests/listen_v1response_results_{channels,utterances}.py ListSequence, ItemItemParams Type-only; widening + correctness fix

Verification

  • mypy src/ clean (801 files)
  • pytest 222 passed / 4 skipped; wire tests 50 passed (assert real request/response bodies incl. aliased types)
  • Targeted runtime check of the serialization short-circuit: aliased types detected (no skip), alias-free graphs skipped, uuiduuid_ dealiasing intact

Notes (non-blocking)

  1. Two *Params request aliases now type as Sequence[...ItemParams] — type-only, no runtime effect; effectively a generator correctness fix.
  2. New TypeAdapter cache is keyed by id(type_) (Fern upstream); safe for the long-lived module-level types the SDK uses.
  3. Shims currently suppress genuine generator improvements (native AgentV1SettingsAgent union, enum audio container) — correct for a non-major release; revisit at the next major.

@GregHolmes GregHolmes merged commit 5c1e845 into main Jun 3, 2026
10 of 12 checks passed
@GregHolmes GregHolmes deleted the gh/sdk-gen-2026-06-02 branch June 3, 2026 12:40
GregHolmes pushed a commit that referenced this pull request Jun 3, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.3.1](v7.3.0...v7.3.1)
(2026-06-03)


### Bug Fixes

* widen pydantic-core bound via fern 5.14.8 regen (closes
[#701](#701))
([#724](#724))
([5c1e845](5c1e845))

---

### What's in this release

This release ships a single PR
([#724](#724)), an
SDK regeneration that bumped the Fern Python generator `5.8.3 → 5.14.8`.

#### Dependency fix (closes #701)
* `pydantic-core` bound widened from `>=2.18.2,<2.44.0` to
`>=2.18.2,<3.0.0` in `pyproject.toml` and `requirements.txt`, resolving
the resolver conflict with `pydantic>=2.13`. `poetry.lock` now resolves
`pydantic-core 2.46.4`.

#### New: client-level `max_retries` parameter (generator feature)
* The sync and async client constructors now accept a `max_retries`
parameter, with a per-request override via `request_options` that takes
precedence over the client-level value.
* This is additive and **does not change default behavior**: the SDK
already retried up to 2 times (on HTTP 408/429/5xx and connection
errors, with backoff) in 7.3.0 — that default of `2` is unchanged. The
only new capability is that retries are now configurable from the client
constructor (e.g. pass `max_retries=0` to disable).
* Files touched (all fully generated): `base_client.py`,
`core/client_wrapper.py`, plus generated coverage in
`tests/utils/test_http_client.py`.

#### Verification (from #724)
* `poetry run mypy src/` — clean (801 files)
* `poetry run pytest -rP .` — 222 passed, 4 skipped (incl. all custom
back-compat regression tests)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: pydantic-core = ">=2.18.2,<2.44.0"

2 participants