-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Consider dropping Pydantic #142
Comments
FWIW, making it work with >= 2.0 is trivial: https://gitlab.archlinux.org/archlinux/packaging/packages/python-pythonfinder/-/blob/main/python-pythonfinder-2.0.4-pydantic2.patch I'm currently doing rebuilds on Arch Linux for pydantic >= 2.0 |
Yes, but in the case of vendoring dependencies and the Python distribution model, it works a bit differently. Linux packaging is different from Python packaging. |
I am not in favor of removing pydantic, I've put quite a bit of time into replacing attr/attrs in pythonfinder, requirementslib and pipenv. We are trying to further overhaul requirementslib and want to make use of the validations with plans to backport changes that are made directly in vendor'd requirementslib back to requirementslib the package on some cadence or interval. We have no immediate plans to upgrade past pydantic 1.x and may revisit how the vendoring is done in pipenv before we would consider 2.x. Either way, changing vendoring or not, it will require serious considerations to go to pydantic 2 and there are more fundamental bugs in requirementslib that should be addressed first. |
I understand that, but still, I believe that pydantic should be dropped. Their migration to Rust want be taken back and one day they won't support v1 anymore. For now, at the very least, you could consider restricting pydantic version to |
Is your objection to just pythonfinder using it because something other than pipenv is using pythonfinder or more broadly speaking? I think to get to pydantic 2, which has some benefits of being faster, we would possible need to not vendor pydantic but install it alongside pipenv. I've spent a bit of time looking more at how poetry installs itself for possible inspiration. |
well, I am part of Poetry core team and we are looking into getting
We are migrating to suggesting |
@Secrus That is interesting, I would be open to a PR that converts pythonfinder to vanilla dataclasses; It would be cool to see poetry using pythonfinder if you head in that direction. I think as far as requirementslib goes, it will keep pydantic for the foreseeable future, at least until that library can be cleaned up but that likely wouldn't affect you. Just a note on latest pythonfinder areas of improvement:
That is also interesting, admittedly I know how much about pipx but I wouldn't want to require another package manager that isn't the standard python package manager |
Restricting this package to v1 only is problematic for downstream distributions, which now have to carry patches and continuously rework them (depending on upstream activity). Could this not have been turned into a conditional import? 😢 |
@dvzrv I am not sure what you mean seeing as pythonfinder won't run on pydantic 2 without code changes. Aside -- I am in favor of removing pydantic to vanilla dataclasses, but I don't have the time to take it on myself at present. |
Yeah, the changes are fairly trivial though (see https://gitlab.archlinux.org/archlinux/packaging/packages/python-pythonfinder/-/blob/main/python-pythonfinder-2.0.5-pydantic2.patch) and could be turned into something that works across 1 and 2 for the time being.
Makes sense. I'll wait then :) |
Late to join the party, but still. |
@oz123 I am up to make the effort, just been busy with other projects lately. |
I'd love to collaborate on that. I am also trying to do the same on plette. |
It would have been great not having to backport the aforementioned pydantic >= 2 patches when packaging for downstream distributions for the latest release (my patch no longer applies, and this extra work has to be done by all downstreams working with pydantic 2). Can we please patch this (I don't really care if the version constraint remains, as we remove that anyways) for the time being? :) |
For anyone needing this, here is a patch for making pythonfinder work with pydantic v2:
|
Why not submit a proper PR? |
The current requirement of pydantic<2 here conflicts with PYPI having pydantic at 2.5.3. The above patch should be either committed, or Pydantic should be dropped. |
We need to do both ... would have been helpful to open that patch as a PR, but I can probably manage it; just have been real busy. It seems just copying that patch doesn't apply directly:
|
Well the tests on dropping pydantic work, opening a PR against pipenv to see how those tests do with it. #157 |
OK, ready for review -- we have a clean test run here and in pipenv with these changes: #157 |
Will you consider dropping
pydantic
in favor ofdataclasses
or just plain Python objects?pydantic
recently released v2 which has its core rewritten in Rust. That will cause major issues when trying to vendorpythonfinder
in projects likepipenv
.The text was updated successfully, but these errors were encountered: