-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New voila labextension path breaks custom setup #1506
Comments
Thanks for commenting @dfguerrerom ! Would you be able to show the very beginning of errors in the JavaScript console? Also can you very the |
could you post a minimal reproduction of your custom hook so we can debug it locally? |
is |
I look for the path of the notebook to get the name of the virtual environment where I need to take the extensions from and (just for testing) I have added the voila labextensions... the returned url is the endpoint where my server serves the files. def get_app_data(base_url: str, app_name: str) -> Tuple[List[str], str]:
"""Get the module data"""
# To the logic to get the app data
jupyter_url = f"/api/apps/labextensions/{app_name}/"
jupyter_paths = [
f"/usr/local/share/jupyter/kernels/venv-{app_name}/venv/share/jupyter/labextensions/"
] + ["/usr/local/share/jupyter/voila/labextensions"]
return jupyter_paths, jupyter_url
def get_app_name(notebook_path: str):
"""Extract the app name from the notebook path"""
return notebook_path.split("apps/")[1].split("/")[0]
def page_config_hook(
page_config: dict,
base_url,
settings,
log,
voila_configuration: VoilaConfiguration,
notebook_path,
):
app_name = get_app_name(notebook_path)
app_extensions_paths, app_extensions_url = get_app_data(base_url, app_name)
page_config["fullLabextensionsUrl"] = app_extensions_url
recursive_update(
page_config,
gpc(app_extensions_paths, logger=log),
)
disabled_extensions = [
"@voila-dashboards/jupyterlab-preview",
"@jupyter/collaboration-extension",
]
disabled_extensions.extend(page_config.get("disabledExtensions", []))
required_extensions = []
federated_extensions = deepcopy(page_config["federated_extensions"])
filtered_extensions = filter_extension(
federated_extensions=federated_extensions,
disabled_extensions=disabled_extensions,
required_extensions=required_extensions,
extension_allowlist=voila_configuration.extension_allowlist,
extension_denylist=voila_configuration.extension_denylist,
)
extensions = maybe_inject_widgets_manager_extension(
filtered_extensions, app_extensions_paths
)
page_config["federated_extensions"] = extensions
return page_config
c.VoilaConfiguration.page_config_hook = page_config_hook
|
True, it doesn't find that file because voila is not installed in my kernel, I was using the system voila paths... but probably, installing voila in my kernel will cause problems if the system version changes... |
I managed to serve the file correctly and it works, can we close it? the issue was on my side |
Happy you managed to fix it!
Do you think we made a mistake making that release a patch release? I'm wondering if we should expect more issues like this one to pop up. |
Closing as fixed for now |
well... that one was my mistake, my PR was on the same release and I was applying the logic of my branch... both were in the same patch. |
my previous logic was only adding the labextensions that were available in the virtual environment that I wanted to use... now I have refactored to also include the voila extensions... however, there's nothing rendered in my voila page.
my federated extensions are:
Is there anything else I've been missing?
Originally posted by @dfguerrerom in #1501 (comment)
The text was updated successfully, but these errors were encountered: