Skip to content
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

ExtensionApp not compatible with extending ServerApp #395

Open
minrk opened this issue Jan 27, 2021 · 2 comments
Open

ExtensionApp not compatible with extending ServerApp #395

minrk opened this issue Jan 27, 2021 · 2 comments
Labels

Comments

@minrk
Copy link
Contributor

minrk commented Jan 27, 2021

I'm investigating jupyterlab/jupyterlab#8807 and discovered that what should work:

from jupyterhub.singleuser import make_singleuser_app
from jupyterlab.labapp import LabApp
app = make_singleuser_app(LabApp)

doesn't. The immediate failure is:

AttributeError: 'LabApp' object has no attribute 'login_handler_class'

The underlying cause is that make_singleuser_app expects either the old NotebookApp or the new ServerApp, but LabApp is actually an ExtensionApp, which has a ServerApp rather than is a ServerApp. The underlying ServerApp class is not accessible (it is hardcoded to ServerApp), and thus not really extensible via normal means. This makes wrapping it not really feasible. Since LabApp is an app that launches a server, it seems like it should really be a ServerApp.

What's the best way to make LabApp or similar applications that really are server applications really extend ServerApp instead of this ExtensionApp wrapper? It seems like ExtensionApp should really subclass ServerApp and call super instead of initializing two global Application instances.

@jasongrout
Copy link
Contributor

I'm curious about this answer too. It's been a bit confusing that we've moved from being a subclass to having an attribute. Is it so that the ExtensionApp can support having either a NotebookApp or a ServerApp attribute to aid in the transition?

@jasongrout
Copy link
Contributor

The notes for today's jupyter server meeting have an excellent exposition on this topic: jupyter-server/team-compass#4 (comment)

Thanks for the explanation!

Zsailer added a commit to Zsailer/jupyter_server that referenced this issue Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants