-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switched Support to Pydantic2 (intermediate breaking change)
- Loading branch information
Showing
4 changed files
with
619 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
""" | ||
A few global defintions | ||
A few global definitions | ||
""" | ||
from typing import TypeVar | ||
|
||
from apischema import schema | ||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
#: A generic Type for use in type hints | ||
T = TypeVar("T") | ||
|
||
|
||
def desc(description: str): | ||
"""a description Annotation to add to our Entity derived Types""" | ||
return schema(description=description) | ||
return Field(description=description) | ||
|
||
|
||
class BaseSettings(BaseModel): | ||
"""A Base class for setting Pydantic model configuration""" | ||
|
||
# Pydantic model configuration | ||
model_config = ConfigDict( | ||
# arbitrary_types_allowed=True, | ||
extra="forbid", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.