Skip to content

Commit

Permalink
pydanticV2 supporting beta (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Jun 19, 2023
1 parent d2a31d1 commit f511243
Show file tree
Hide file tree
Showing 23 changed files with 600 additions and 796 deletions.
2 changes: 1 addition & 1 deletion fast_depends/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""FastDepends - extracted and cleared from HTTP domain Fastapi Dependency Injection System"""

__version__ = "1.1.7"
__version__ = "2.0.0b"
6 changes: 3 additions & 3 deletions fast_depends/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from fast_depends.provider import dependency_provider
from fast_depends.usage import Depends, inject
from fast_depends.dependencies import dependency_provider
from fast_depends.use import Depends, inject

__all__ = (
"inject",
"Depends",
"dependency_provider",
"inject",
)
20 changes: 20 additions & 0 deletions fast_depends/_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from pydantic.version import VERSION as PYDANTIC_VERSION

PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")

from pydantic import BaseModel, create_model

if PYDANTIC_V2:
from pydantic._internal._typing_extra import (
eval_type_lenient as evaluate_forwardref,
)
else:
from pydantic.typing import evaluate_forwardref


__all__ = (
"BaseModel",
"create_model",
"evaluate_forwardref",
"PYDANTIC_V2",
)
276 changes: 0 additions & 276 deletions fast_depends/construct.py

This file was deleted.

7 changes: 7 additions & 0 deletions fast_depends/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from fast_depends.core.build import build_call_model
from fast_depends.core.model import CallModel

__all__ = (
"CallModel",
"build_call_model",
)
Loading

0 comments on commit f511243

Please sign in to comment.