Skip to content

Migrate to Pydantic V2, drop v1 shim, support Python 3.13 and 3.14 - #477

Open
prithsk wants to merge 1 commit into
replicate:mainfrom
prithsk:pydantic-v2-py314
Open

prithsk wants to merge 1 commit into
replicate:mainfrom
prithsk:pydantic-v2-py314

Conversation

@prithsk

@prithsk prithsk commented Oct 17, 2026

Copy link
Copy Markdown

Removes the pydantic.v1 import shim from seven modules. Replaces nine .dict() calls with .model_dump(). Adds explicit None defaults to 38 Optional fields, since V2 no longer treats Optional as defaulting to None. Requires pydantic>=2.0 and Python>=3.9. Adds 3.13 and 3.14 to CI and drops EOL 3.8. No behavior change; 158 tests pass before and after. Closes #452, closes #454.

Fixes replicate#452, replicate#454.

- Remove the try/except pydantic.v1 import shim in seven modules and
  import pydantic directly.
- Replace .dict() with .model_dump() at nine call sites.
- Add explicit = None defaults to 38 Optional fields. V1 treated
  Optional as implicitly defaulting to None; V2 does not.
- Require pydantic>=2.0 and Python>=3.9.
- Add 3.13 and 3.14 to the CI matrix, drop EOL 3.8.

No behavior change: 158 tests pass before and after on 3.12.
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.

replicate does not work on Python 3.14 Python 3.14 incompatibility due to Pydantic V1 usage

1 participant