Skip to content

[18.0][FIX] test-requirements: pin pydantic<2.14 - #1045

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
SamyShaawat:fix/18.0-test-requirements-pin-pydantic
Oct 21, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
SamyShaawat:fix/18.0-test-requirements-pin-pydantic

Conversation

@SamyShaawat

Copy link
Copy Markdown

Problem

The CI cannot initialize the test database of the PRs on 18.0 ("Initialize test
db" step of the "test with Odoo" and "test with OCB" jobs):

AttributeError: module 'pydantic._internal._generate_schema' has no attribute 'get_type_ref'

extendable-pydantic (latest release: 1.4.1) uses
pydantic._internal._generate_schema.get_type_ref at import time. pydantic 2.14
removed it, so extendable_fastapi (a dependency of cross_connect_server)
cannot be imported with the pydantic that the CI image now installs.

I reproduced it in a clean virtualenv: with pydantic 2.14.1 the import fails
with this error, with pydantic 2.13.5 it works.

Fix

Keep pydantic below 2.14 in test-requirements.txt until extendable-pydantic
supports it. This is only a test dependency; nothing changes for the addons.

Notes

This should be dropped once extendable-pydantic is compatible with
pydantic 2.14.

pydantic 2.14 removed `pydantic._internal._generate_schema.get_type_ref`, which
`extendable-pydantic` (up to 1.4.1) still uses at import time. With the latest
pydantic of the CI image, `extendable_fastapi` (needed by `cross_connect_server`)
cannot be imported and the test database cannot be initialized:

    AttributeError: module 'pydantic._internal._generate_schema' has no attribute 'get_type_ref'

Keep pydantic below 2.14 for the tests until extendable-pydantic supports it.
@SamyShaawat

Copy link
Copy Markdown
Author

@sbidoul could you please review this? It fixes the "Initialize test db" step of the 18.0 CI (all jobs with cross_connect_server's dependency extendable_fastapi), which currently fails on every PR because of pydantic 2.14. All the test jobs pass with the pin on this PR. Thanks!

@sbidoul

sbidoul commented Oct 21, 2026

Copy link
Copy Markdown
Member

@lmignon I just wanted to check how close you are to releasing lmignon/extendable-pydantic#26. No pressure at all, of course, but if you plan to release soon, it may not be necessary to merge this one. If you need more time, no worries, we can merge this.

@sbidoul

sbidoul commented Oct 21, 2026

Copy link
Copy Markdown
Member

Let's merge this, it's easy to revert.

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1045-by-sbidoul-bump-nobump, awaiting test results.

@lmignon

lmignon commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

@MiquelRForgeFlow @RicardCForgeFlow @SamyShaawat Could you please test lmignon/extendable#19 and lmignon/extendable-pydantic#26? These changes fix the compatibility issue.

I'd like to release new versions of both libraries by the end of this week. They work well in my environments, but I'd appreciate some additional feedback before releasing them.

For reference, there's also another proposed improvement here: OCA/rest-framework#662.

@OCA-git-bot
OCA-git-bot merged commit 779e0b8 into OCA:18.0 Oct 21, 2026
10 of 11 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 779e0b8. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants