Skip to content

Commit

Permalink
Merge pull request #218 from davidbrochart/update_fastapi
Browse files Browse the repository at this point in the history
Remove FastAPI monkey-patch
  • Loading branch information
davidbrochart committed Sep 5, 2022
2 parents 5e56c32 + d1a33ab commit 9dbcd30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
12 changes: 1 addition & 11 deletions plugins/yjs/fps_yjs/routes.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import asyncio
import re
from datetime import datetime
from pathlib import Path
from typing import Optional, Set, Tuple
from typing import Optional, Tuple

import fastapi
from fastapi import APIRouter, Depends, WebSocketDisconnect
from fps.hooks import register_router # type: ignore
from fps_contents.routes import read_content, write_content # type: ignore
Expand All @@ -27,14 +25,6 @@ class JupyterSQLiteYStore(SQLiteYStore):
router = APIRouter()


def get_path_param_names(path: str) -> Set[str]:
return {name.split(":")[0] for name in re.findall("{(.*?)}", path)}


# FIXME: remove the patch when https://github.com/tiangolo/fastapi/pull/3879 is merged
fastapi.utils.get_path_param_names.__code__ = get_path_param_names.__code__


def to_datetime(iso_date: str) -> datetime:
return datetime.fromisoformat(iso_date.rstrip("Z"))

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package_dir =
python_requires = >=3.7

install_requires =
fastapi >=0.82.0
fps >=0.0.19
fps-uvicorn >=0.0.19
fps-contents
Expand Down

0 comments on commit 9dbcd30

Please sign in to comment.