bump-pydantic
https://github.com/pydantic/bump-pydantic
Convert
#Pydantic
from V1 to V2 ♻️
blackやisortみたいにソースコード自体を書き換える
bump-pydantic
diffを見たい場合
bump-pydantic --diff <path>
0.1.0でのみ有効。ref:
https://github.com/pydantic/bump-pydantic/issues/77#issuecomment-1637437448
書き換えRuleを適用していく
指摘内容を
Migration Guide (Pydantic V2)
を見るのがよさそう
パッケージだけでなく単一のファイルも渡せる?
https://github.com/pydantic/bump-pydantic/commit/481ec109bf64773991f6a86c3973151662500469
venvの中まで探しに行く動きだったので、ディレクトリを切ってその中にファイルをコピーし、ディレクトリをパッケージとして指定して動かした
BP007: Replace decorators
BP008: Replace con* functions by Annotated versions
依存ライブラリ
typer
LibCST
開発時:
Hatch