Skip to content

Preparing for Pydantic v2 release #532

Open
@bpenteado

Description

@bpenteado

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the SQLModel documentation, with the integrated search.
  • I already searched in Google "How to X in SQLModel" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to SQLModel but to Pydantic.
  • I already checked if it is not related to SQLModel but to SQLAlchemy.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

# any sqlmodel code is ok, providing that the development version of Pydantic v2 is installed (local or direct repo installation)

import SQLModel

Description

After locally installing Pydantic v2 (main development branch)... :

>> python -c "import pydantic; print(pydantic.__version__)"
2.0.0.dev0

... SQLModel breaks at import time:

>> python -c "import sqlmodel"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/bpenteado/opt/miniconda3/envs/lamin-dev/lib/python3.9/site-packages/sqlmodel/__init__.py", line 137, in <module>
    from .main import SQLModel as SQLModel
  File "/Users/bpenteado/opt/miniconda3/envs/lamin-dev/lib/python3.9/site-packages/sqlmodel/main.py", line 27, in <module>
    from pydantic.errors import ConfigError, DictError
ImportError: cannot import name 'ConfigError' from 'pydantic.errors' (/Users/bpenteado/laminlabs/pydantic/pydantic/errors.py)

Is there any roadmap or planning for preparing SQLModel for Pydantic V2?

This is not a request per se, but a simple inquiry as was done in the two issues below. Hopefully it serves as a watcher/tracker for this key transition:

Operating System

Linux, Windows, macOS, Other

Operating System Details

No response

SQLModel Version

0.0.8

Python Version

3.9.12

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions