-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pydantic 2.0 Migration Plan #133
Comments
I think that would be good idea to move with newer Pedantic 2.x. Also I think that it would be good idea to wait for another new release of Pydantic for proven stabilities as well other popular library is starting to support. |
@nazrulworld about 4 days after your last comment here FastAPI moved to pydantic 2.0 haha. The minor versions are restricted, but they have migrated. |
Checking in to see if I can help on this issue. Is anyone working on it. If not, will open a PR. |
@bwalsh thanks a lot, you are welcome to open any PR. |
Ouch. This will be a lot of work 🤯 Currently stuck on AbstractBaseType see here. Wondering if there is a better way without relying on internals
|
It will be a while before there is a PR on this one. 1: I don't think a brute force 'liftover' will work. Let me know your thoughts |
Just an fyi. I had run into dependency resolution issues using poetry when trying to comingle Pydantic V2 currently provides access to the v1 api via the Tests and linting are passing but mypy (the typechecker) is complaining about a transitive dependency on numpy that it's unhappy about
I'll look into resolving that last issue (suggestions welcome!) as I'm able and hopefully this will help keep things moving forward :) |
Merged! #147 Now we actually need to migrate from |
Thank you! Just curious when we might see this released? Not trying to pressure, just want to set a reminder to check back. |
@Tshimanga Thanks very much for taking the initiative. |
@jstoebel we have an issue #144, may be good to have a new release after fixing this. |
Here we go! https://pypi.org/project/fhir.resources/7.1.0/ @jstoebel |
Nice work everyone! |
So this isn't an actual migration though right? It's still using the v1 schema? |
If so you may want to keep this issue open. |
Correct, I didn't actually migrate off the v1 api. I just updated the pydantic dependency to the v2.x and adjusted the imports accordingly. There will still need to be work done to migrate to the v2 api, but In the meantime this will appease dependency resolution for package managers like Poetry when trying to co-mingle fhir.resources with projects like fast api that have already upgraded. I agree that this issue is still unresolved. I would be interested in picking @bwalsh and @nazrulworld 's brains on the current best thinking around the actual api migration. Updating import statements didn't require a terribly deep understanding on how everything currently hooks together. |
I've started a branch and draft pr for collaborating on the pydantic v2 migration here #148 I think that we'll probably have a lot of commit by commit discussion, and it may take a while; but i wanted to get some forward movement going :) Anyone else with 2 cents to give please chime in as well! |
fhir-resources==7.0.1
Python 3.11.3
Description
Pydantic 2.0 was released on Friday. New version has a lot of underlying changes + some API changes -- see migration guide.
Is there a plan for fhir.resources to support the new version of Pydantic? Please let me know if you need a hand migrating. I use this library all the time and would love to contribute
What I Did
Created a fresh virtual environment with the following requirements file:
Tried to run the Quickstart example in the README and got the following error:
The text was updated successfully, but these errors were encountered: