rstcheck / rstcheck-core

Core library behind rstcheck.
http://rstcheck-core.rtfd.io/
MIT License
4 stars 8 forks source link

Update pydantic dependency to >= 2 #46

Closed dvzrv closed 1 year ago

dvzrv commented 1 year ago

Check List

Resolves: #

I tried adapting the code for pydantic >= 2. However, there are still weird warnings in the docs-* tox targets that I can not figure out, so those will likely fail.

WARNING: Failed guarded type import with ImportError("cannot import name 'AbstractSetIntStr' from 'pydantic._internal._utils' (/home/user/rstcheck-core/.tox/docs/lib/python3.11/site-packages/pydantic/_internal/_utils.py)")

AFAICT, the type in question is not directly used in this code base but might be dragged in by something else. I can't figure out from where and how to not have the tox targets fail on this. Some feedback would be greatly appreciated!

Closes #44

dvzrv commented 1 year ago

cc @polyzen

Cielquan commented 1 year ago

Will try to take a look on it soon.

hojo0590 commented 1 year ago

In case you need more time to figure this out pydantic offers v1 support even in versions greater 2.0.
So for a 'quick compatibility fix' you could go for from pydantic import v1 as pydantic (see their Readme) and tackle this in the near future.

Cielquan commented 1 year ago

I think we should give it a bit more time before dropping support for v1. Therefore the approach suggested by @hojo0590 would be better. I guess an Import-Try-Except for the pydantic stuff would be the best way to implement this.

I would push the drop of v1 support to the end of this year. This should be plenty of time.

Cielquan commented 1 year ago

I just resolved the changelog merge conflict real quick.