Skip to content

Commit

Permalink
Use pydantic v2 (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Jul 13, 2023
1 parent 389d592 commit bdca3e0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ jobs:
pip install -e plugins/login
- name: Check Release
if: ${{ matrix.group == 'check_release' }}
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
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 bdca3e0

Please sign in to comment.