Skip to content

Commit

Permalink
Use pydantic v2
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Jul 12, 2023
1 parent 389d592 commit 3ef87e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions jupyverse_api/jupyverse_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Dict

from pydantic import BaseModel, Extra
from pydantic import BaseModel

from .app import App

Expand All @@ -18,8 +18,7 @@ def __call__(cls, *args, **kwargs):


class Config(BaseModel):
class Config:
extra = Extra.forbid
model_config = {"extra": "forbid"}


class Router:
Expand Down
2 changes: 1 addition & 1 deletion jupyverse_api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"pydantic >=1.10.6,<2",
"pydantic >=2,<3",
"fastapi >=0.95.0,<1",
"rich-click >=1.6.1,<2",
"asphalt >=4.11.0,<5",
Expand Down
2 changes: 1 addition & 1 deletion plugins/contents/fps_contents/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async def read_content(
if get_content:
if path.is_dir():
content = [
(await self.read_content(subpath, get_content=False)).dict()
(await self.read_content(subpath, get_content=False)).model_dump()
for subpath in path.iterdir()
if not subpath.name.startswith(".")
]
Expand Down

0 comments on commit 3ef87e0

Please sign in to comment.