diff --git a/voila/app.py b/voila/app.py index ba45285fb..28b844d9c 100644 --- a/voila/app.py +++ b/voila/app.py @@ -135,9 +135,7 @@ class Voila(Application): jupyverse = Bool( False, config=True, - help=_( - "Use Jupyverse backend" - ), + help=_("Use Jupyverse backend"), ) description = Unicode( """voila [OPTIONS] NOTEBOOK_FILENAME @@ -791,7 +789,9 @@ def start(self): try: from fps_voila import run_application except ImportError: - raise RuntimeError("Please install fps-voila in order to use the Jupyverse backend") + raise RuntimeError( + "Please install fps-voila in order to use the Jupyverse backend" + ) run_application( settings, diff --git a/voila/jupyverse/fps_voila/main.py b/voila/jupyverse/fps_voila/main.py index 50b825c17..8c8355f00 100644 --- a/voila/jupyverse/fps_voila/main.py +++ b/voila/jupyverse/fps_voila/main.py @@ -1,7 +1,6 @@ import pkg_resources from asphalt.core import Component, ContainerComponent, Context -from asphalt.web.fastapi import FastAPIComponent from jupyverse_api.app import App from jupyverse_api.auth import Auth @@ -10,13 +9,13 @@ class VoilaComponent(Component): def __init__( - self, - *, - settings, - voila_configuration, - static_paths, - base_url, - ): + self, + *, + settings, + voila_configuration, + static_paths, + base_url, + ): super().__init__() self.settings = settings self.voila_configuration = voila_configuration @@ -60,7 +59,10 @@ def __init__( self.port = port async def start(self, ctx: Context) -> None: - asphalt_components = {ep.name: ep for ep in pkg_resources.iter_entry_points(group="asphalt.components")} + asphalt_components = { + ep.name: ep + for ep in pkg_resources.iter_entry_points(group="asphalt.components") + } self.add_component( "fastapi", diff --git a/voila/jupyverse/fps_voila/routes.py b/voila/jupyverse/fps_voila/routes.py index c583262a2..004328ac1 100644 --- a/voila/jupyverse/fps_voila/routes.py +++ b/voila/jupyverse/fps_voila/routes.py @@ -15,14 +15,14 @@ class Voila(Router): def __init__( - self, - app: App, - auth: Auth, - settings, - voila_configuration, - static_paths, - base_url, - ): + self, + app: App, + auth: Auth, + settings, + voila_configuration, + static_paths, + base_url, + ): super().__init__(app=app) router = APIRouter() @@ -47,6 +47,7 @@ async def get_root(request: Request): MultiStaticFiles(directories=static_paths, check_dir=False), ) + class MultiStaticFiles(StaticFiles): def __init__(self, directories: List[PathLike] = [], **kwargs) -> None: super().__init__(**kwargs)