Question re package naming (i.e. pydantic1 / pydantic2) #5402
Replies: 8 comments 28 replies
-
maybe to put this another way. Do you imagine that it will be possible for packages that use pydantic <v2 and packages that use ≥v2 to co-exist in the same environment? Or that that will be more or less impossible? And if the latter, do you have thoughts on how to "help" the ecosystem deal with this incompatibility? (such as a differently named package?) |
Beta Was this translation helpful? Give feedback.
-
This has been discussed before: #4649 |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response. I'm not sure I agree that's the same issue really. That issue was really more about a single large project incrementally updating itself. My point is about compatibility across multiple unrelated libraries with different authors: As soon as To summarize points that were made there, you said:
I do, however, see this is a pydantic issue. Obviously, pydantic is a very widely used package these days. And while a major use case might be applications/projects that don't need to co-exist in an environment with other projects, another very valid use case is python libraries that use pydantic. As soon as pydantic v2 is released as a non-pre-release on pypi under the name I'm hoping that pydantic has a solution "ready" for libraries (not just applications) before releasing pydantic v2 under the name |
Beta Was this translation helpful? Give feedback.
-
The idea of This wouldn't work if we released a pydantic v1 package. |
Beta Was this translation helpful? Give feedback.
-
Thanks all for your comments. I do still feel like my point has been missed. Im not worried about my packages or my migration plan or strategy. I know I can use pinning strategies, and such and migrate when I desire (as long as no other package shows up in an environment with one of my libraries with an incompatible pin). As a developer on projects (like napari/napari) that have many plugins and complicated environment solving, my concern was more that pydantic will soon be causing unsolvable environments quite a lot. And that if it notices that possibility, it could do something to ameliorate it. Anyway, I respect that you've got lots of stuff going on at the moment. Thanks for the conversation. |
Beta Was this translation helpful? Give feedback.
-
one last thing... I did find this comment from @samuelcolvin: #4649 (reply in thread)
which got a number of +1s ... so it does sound like there had been at least a little internal support for this idea. |
Beta Was this translation helpful? Give feedback.
-
The way this was solved with python 2 vs 3, and the way I think @tiangolo is intending to solve this with fastapi is to support both pydantic v1 and v2 for a while. This might seem like lots of work, but actually it's probably as simple as copying your code and having two modules - one for V1 and one for V2. |
Beta Was this translation helpful? Give feedback.
-
Signing of this thread, it has been a tremendous brain-exercise trying to emphasize the pain and suffering for those that are affected by this issue. I really wish there was a golden bullet for this issue, but I don't think there is... Not something that makes everybody happy! I guess the silver-lining is that everyone here has a lot of opinions, and expertise that can be put to better use in their IDEs where they actually do the work to move over to the more safe and efficient version of Pydantic, which is V2. I know it is dissatisfying to be told you have to work a little extra for something you didn't perhaps ask for, but Pydantic is mostly used in FastAPI (correct me if I am wrong). We come second, I personally can't wait to use Kind regards |
Beta Was this translation helpful? Give feedback.
-
First off, thanks a million for all of your hard work on pydantic v1 and the exciting changes in v2. I'm thrilled by the prospects and have been diving in to begin migrating all of my pydantic-using packages. Congrats on all the progress so far 🏆
As I see just how big of an API change it is, i find myself wondering how it's going to affect environment-solving going forward, and I'm curious whether there's already been a discussion about having a differently named package for v1 and v2. I can definitely understand that you might not want to name the new version
pydantic2
, but seeing as it is mostly a different API, have you considered releasing a newpydantic1
package on pypi (something that would not receive any updates after the final pydantic v1 release)? (apologies if I've missed a pre-existing issue on this)My primary concern is that there will be some packages that use pydantic for whom it's simply not worth the time to update, and they will likely leave
pydantic<2
in their install requires and be done with it (at least for the foreseable future). Their package works fine for their needs and they're not looking to update. This of course works fine for applications who aren't likely to appear in an environment with other packages (e.g. django or fastAPI apps, etc...). But for libraries that try to coexist in python environment (where we obviously have a flat single-version package structure unlike node) I do fear a little bit the upcoming version clashes.I do realize that the
pydantic1
strategy still won't work for packages that don't change their install requirements topydantic1
in their project metadata and go through and update all of their imports... but it still seems like a possible escape hatch that will enable coexistence of packages that might otherwise break each other.Please don't get me wrong: it's super clear you've been very transparent and diligent about all the breaking API changes. Now is definitely the right time, and you're giving everyone plenty of time! Curious to hear your thoughts or prior discussion on this. thanks!
Beta Was this translation helpful? Give feedback.
All reactions