Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 5, 2023
1 parent 7929bda commit 14b0563
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
8 changes: 4 additions & 4 deletions voila/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
20 changes: 11 additions & 9 deletions voila/jupyverse/fps_voila/main.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand Down
17 changes: 9 additions & 8 deletions voila/jupyverse/fps_voila/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit 14b0563

Please sign in to comment.