Skip to content

fix: widen pydantic-core upper bound to <3.0.0 - #723

Closed
gavin913-lss wants to merge 1 commit into
deepgram:mainfrom
gavin913-lss:fix/pydantic-core-upper-bound
Closed

fix: widen pydantic-core upper bound to <3.0.0#723
gavin913-lss wants to merge 1 commit into
deepgram:mainfrom
gavin913-lss:fix/pydantic-core-upper-bound

Conversation

@gavin913-lss

Copy link
Copy Markdown

Problem

deepgram-sdk pins pydantic-core>=2.18.2,<2.44.0, but pydantic>=2.13.0 requires pydantic-core==2.46.3. This makes it impossible to install deepgram-sdk alongside modern pydantic:

Because pydantic==2.13.3 depends on pydantic-core==2.46.3 and deepgram-sdk==7.0.0
depends on pydantic-core>=2.18.2,<2.44.0, we can conclude that deepgram-sdk==7.0.0 and
pydantic==2.13.3 are incompatible.

Fixes #701

Fix

Widen the pydantic-core upper bound from <2.44.0 to <3.0.0.

pydantic-core follows calver and the validation/serialization API is stable within major versions. The lower bound >=2.18.2 is preserved to maintain backward compatibility.

Testing

Verified that pydantic==2.13.3 + pydantic-core==2.46.3 satisfies the new constraint >=2.18.2,<3.0.0.

pydantic 2.13.3 requires pydantic-core==2.46.3, but the current
constraint pins pydantic-core<2.44.0, making deepgram-sdk
uninstallable alongside pydantic>=2.13.0.

Widen the upper bound to <3.0.0 since pydantic-core follows
calver and the API is stable within major versions.

Fixes deepgram#701
@gavin913-lss
gavin913-lss requested a review from GregHolmes as a code owner June 2, 2026 07:45
GregHolmes added a commit that referenced this pull request Jun 3, 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.

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
@GregHolmes

Copy link
Copy Markdown
Contributor

Thank you for raising this PR! It has been superseded by #724, which widens pydantic-core to <3.0.0 at the generator level and also updates requirements.txt + poetry.lock. Shipping in 7.3.1 (#725). Closing as resolved, I appreciate the fix.

@GregHolmes GregHolmes closed this Jun 3, 2026
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