Repository navigation
[18.0][FIX] test-requirements: pin pydantic<2.14 - #1045
Conversation
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.
|
@sbidoul could you please review this? It fixes the "Initialize test db" step of the 18.0 CI (all jobs with |
|
@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. |
|
Let's merge this, it's easy to revert. /ocabot merge nobump |
|
On my way to merge this fine PR! |
|
@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. |
|
Congratulations, your PR was merged at 779e0b8. Thanks a lot for contributing to OCA. ❤️ |
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):
extendable-pydantic(latest release: 1.4.1) usespydantic._internal._generate_schema.get_type_refat import time. pydantic 2.14removed it, so
extendable_fastapi(a dependency ofcross_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.txtuntilextendable-pydanticsupports it. This is only a test dependency; nothing changes for the addons.
Notes
This should be dropped once
extendable-pydanticis compatible withpydantic 2.14.