ITISFoundation / osparc-simcore

🐼 osparc-simcore simulation framework
https://osparc.io
MIT License
43 stars 27 forks source link

Major upgrade to pydantic 2.0 #4481

Open pcrespov opened 1 year ago

pcrespov commented 1 year ago

Planned changes

Major upgrade not out-of-the box and requires some coordination. This upgrade will bring substantial speedup to the code. It would be desirable to measure the improvement. Should we setup some type of benchmark?

Both libraries have been releases so I added a constraint in requirements/constraints.txt

We should start testing first the upgrade with the packages and then when we understand the migration mechanisms we can do the rest of the repository.

### Tasks
- [x] migrate `settings-library`, specially `CustomBaseSettings` @pcrespov
- [x] migrate `models-library`

This is a sub issue from https://github.com/ITISFoundation/osparc-issues/issues/675

### Sundae
- [ ] explore the migration path @pcrespov
sanderegg commented 1 year ago

@pcrespov explore the migration path

giancarloromeo commented 1 month ago

This article contains useful tips on how to approach the migration: https://medium.com/codex/migrating-to-pydantic-v2-5a4b864621c3

giancarloromeo commented 1 month ago

FastAPI doesn't support a mix of pydantic version. The installed one determines the models version and so on.

See: https://github.com/fastapi/fastapi/issues/10360

We will proceed updating the libraries/services one by one. :crossed_fingers: