Skip to content

Commit

Permalink
fix: altair now works in voila
Browse files Browse the repository at this point in the history
Fixes #486

We now default to not using the CDN proxy when we detect we are running
in voila.
  • Loading branch information
maartenbreddels committed Jan 30, 2024
1 parent 19628ee commit 1eaa6be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion solara/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Config:


# in colab or vscode there is not solara cdn proxy available
_should_use_proxy = not (solara.util.is_running_in_colab() or solara.util.is_running_in_vscode())
_should_use_proxy = not (solara.util.is_running_in_colab() or solara.util.is_running_in_vscode() or solara.util.is_running_in_voila())


class Assets(BaseSettings):
Expand Down
4 changes: 4 additions & 0 deletions solara/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,7 @@ def is_running_in_colab():

def is_running_in_vscode():
return "VSCODE_PID" in os.environ or "VSCODE_CWD" in os.environ


def is_running_in_voila():
return os.environ.get("SERVER_SOFTWARE", "").startswith("voila")
3 changes: 0 additions & 3 deletions tests/integration/cdn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
def test_cdn_via_altair(ipywidgets_runner, page_session: playwright.sync_api.Page, request, assert_solara_snapshot):
if request.node.callspec.params["ipywidgets_runner"] != "solara" and request.node.callspec.params["solara_server"] != SERVERS[0]:
pytest.skip("No need to run this test for all servers.")
if request.node.callspec.params["ipywidgets_runner"] == "voila":
# see https://github.com/widgetti/solara/issues/486
pytest.skip("Does not work with Voila.")

# this function (or rather its lines) will be executed in the kernel
# voila, lab, classic notebook and solara will all execute it
Expand Down

0 comments on commit 1eaa6be

Please sign in to comment.