Skip to content

Commit

Permalink
Add asphalt dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 16, 2023
1 parent 87390fd commit 065e65f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion jupyverse_api/jupyverse_api/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def _include_router(self, router, _type, **kwargs) -> None:
for _router, _paths in self._router_paths.items():
if path in _paths:
raise RuntimeError(
f"{_type} adds a handler for a path that is already defined in {_router}: {path}"
f"{_type} adds a handler for a path that is already defined in "
f"{_router}: {path}"
)
logger.debug("%s added handler for path: %s", _type, path)
new_paths.append(path)
Expand Down
9 changes: 5 additions & 4 deletions plugins/auth/fps_auth/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ def websocket_auth(self, permissions: Optional[Dict[str, List[str]]] = None):
"""
A function returning a dependency for the WebSocket connection.
:param permissions: the permissions the user should be granted access to. The user should have
access to at least one of them for the WebSocket to be opened.
:returns: a dependency for the WebSocket connection. The dependency returns a tuple consisting
of the websocket and the checked user permissions if the websocket is accepted, None otherwise.
:param permissions: the permissions the user should be granted access to. The user should
have access to at least one of them for the WebSocket to be opened.
:returns: a dependency for the WebSocket connection. The dependency returns a tuple
consisting of the websocket and the checked user permissions if the websocket is accepted,
None otherwise.
"""

async def _(
Expand Down
3 changes: 2 additions & 1 deletion plugins/auth/fps_auth/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ async def get_api_me(
}

# redefine GET /me because we want our current_user dependency
# it is first defined in users_router and so it wins over the one in fapi_users.get_users_router
# it is first defined in users_router and so it wins over the one in
# fapi_users.get_users_router
users_router = APIRouter()

@users_router.get("/me")
Expand Down
7 changes: 4 additions & 3 deletions plugins/yjs/fps_yjs/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ async def serve(self):
# the source file (no change history)
read_from_source = True
if not read_from_source:
# if YStore updates and source file are out-of-sync, resync updates with source
# if YStore updates and source file are out-of-sync, resync updates
# with source
if self.room.document.source != model.content:
read_from_source = True
if read_from_source:
Expand Down Expand Up @@ -122,8 +123,8 @@ async def on_message(self, message: bytes) -> bool:
byte = message[0]
msg = message[1:]
if byte == RENAME_SESSION:
# The client moved the document to a different location. After receiving this message,
# we make the current document available under a different url.
# The client moved the document to a different location. After receiving this
# message, we make the current document available under a different url.
# The other clients are automatically notified of this change because
# the path is shared through the Yjs document as well.
new_room_name = msg.decode("utf-8")
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ keywords = ["jupyter", "server", "fastapi", "plugins"]
dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"asphalt >=4.11.0,<5",
"asphalt-web[fastapi] >=1.1.0,<2",
"jupyverse-api",
"fps-contents",
"fps-kernels",
Expand Down

0 comments on commit 065e65f

Please sign in to comment.