Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.6.1"
python = "^3.8.1"
SQLAlchemy = ">=1.4.17,<1.5.0"
pydantic = "^1.8.2"
pydantic = ">=2.0,<3.0"
sqlalchemy2-stubs = {version = "*", allow-prereleases = true}

[tool.poetry.dev-dependencies]
Expand All @@ -44,7 +44,7 @@ mkdocs = "^1.2.1"
mkdocs-material = "^8.1.4"
mdx-include = "^1.4.1"
coverage = {extras = ["toml"], version = "^5.5"}
fastapi = "^0.68.0"
fastapi = "^0.115.12"
requests = "^2.26.0"
autoflake = "^1.4"
isort = "^5.9.3"
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import black
from jinja2 import Template
from pydantic import BaseModel
from pydantic.v1 import BaseModel

template_path = Path(__file__).parent.parent / "sqlmodel/sql/expression.py.jinja2"
destiny_path = Path(__file__).parent.parent / "sqlmodel/sql/expression.py"
Expand Down
17 changes: 10 additions & 7 deletions sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Callable,
ClassVar,
Dict,
ForwardRef,
List,
Mapping,
Optional,
Expand All @@ -23,13 +24,13 @@
cast,
)

from pydantic import BaseConfig, BaseModel
from pydantic.errors import ConfigError, DictError
from pydantic.fields import FieldInfo as PydanticFieldInfo
from pydantic.fields import ModelField, Undefined, UndefinedType
from pydantic.main import ModelMetaclass, validate_model
from pydantic.typing import ForwardRef, NoArgAnyCallable, resolve_annotations
from pydantic.utils import ROOT_KEY, Representation
from pydantic.v1 import BaseConfig, BaseModel
from pydantic.v1.errors import ConfigError, DictError
from pydantic.v1.fields import FieldInfo as PydanticFieldInfo
from pydantic.v1.fields import ModelField, Undefined, UndefinedType
from pydantic.v1.main import validate_model
from pydantic.v1.typing import NoArgAnyCallable, resolve_annotations
from pydantic.v1.utils import ROOT_KEY, Representation
from sqlalchemy import (
Boolean,
Column,
Expand All @@ -53,6 +54,8 @@

_T = TypeVar("_T")

ModelMetaclass = type(BaseModel)


def __dataclass_transform__(
*,
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any, Callable, Dict, List, Union

import pytest
from pydantic import BaseModel
from pydantic.v1 import BaseModel
from sqlmodel import SQLModel
from sqlmodel.main import default_registry

Expand Down
Loading