-
Notifications
You must be signed in to change notification settings - Fork 7
Take decision on Pydantic version for core library and dev tools. #802
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
Comments
I would go for option 1 now. The number of packages with active development is limited, and helping them transition should not be too much work. Meanwhile, we can only pin version 1.1.0 for more stale packages for now. That said, in the long run, I favor option 2. It would give us much more flexibility regarding back compatibility.
So, while changes might be smaller in the future, we can not exclude more inconsistencies in schema generation. |
Agreed. Let's go with option 1 now, I don't think that will be hard for current package developers to adopt. We can still think of having the dev package separate later :) |
(cc @lorenzocerrone @jluethi)
We still have something to clarify concerning the Pydantic dependency version.
fractal-tasks-core
can only coexist with Pydantic v2. The most natural approach here would be to change the dependency constraint topydantic>=2
.pydantic_v1
orpydantic_v2
manifests. Note that in this scenario we would need fractal-tasks-core to coexist with Pydantic v1 package, which is in contrast with the previous point.dev
is nested within the core library main package (fractal_tasks_core
) we don't have the option to be more flexible for thedev
subpackage while being less flexible for its parent package. This is based on my understanding of import checks (see details below), but I'm curious to know about other options.At the moments I don't see a way out. We would have to make the next
fractal-tasks-core
version depend on Pydantic V2. This means that v1.1.0 could be used as a transitional version, but package developers who import fromfractal_tasks_core
would not be able to use Pydantic V1 (this is probably a minor issue).Two options would remain in terms of schema-generation tools:
fractal_tasks_core
, which means that they will only generate pydantic v2 schemas from now on.fractal_tasks_core.dev
into a separate package, where we can keep its dependencies more flexible than thefractal_tasks_core
ones.I see the benefit of option 2, overall, but it's something that would clearly take more work. Option 1 is actually a no-effort change for any task developer who was not pinning their pydantic dependency, and probably would only affect very few users (who, for the moment, would need to pin
fractal-tasks-core
to be able to stick with Pydantic V1).My understanding is based on the following example
where I am not able to bypass the import of the parent package when importing from
dev
.I am happy to hear about something I missed.
The text was updated successfully, but these errors were encountered: