jupyter-server/jupyter-resource-usage

Clarify notebook/jupyter_server usage

fcollonval opened this issue · 2 comments

Description

The code is not a full valid jupyter_server extension as it is based on notebook handler:

from notebook.base.handlers import IPythonHandler

Dependency needs update:

install_requires=["notebook>=5.6.0", "prometheus_client", "psutil>=5.6.0"],

The backport entrypoint is missing:

_load_jupyter_server_extension = load_jupyter_server_extension

Expected behavior

The extension is fully using jupyter_server.

Context

The mix-up was seen following that issue: jupyter-server/jupyter_server#488

After changing the parameter to c.Spawner.cmd = ["jupyter-labhub"], the warning is emitted only for this handler:

python3.7/site-packages/notebook/base/handlers.py:131: RuntimeWarning: Expected to see HubAuthenticatedHandler in <class 'jupyter_resource_usage.api.ApiHandler'>.mro()

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

jtpio commented

Thanks @fcollonval for the report.

This might also explain some of the issues folks have been having in #91.

Please don't hesitate to send a PR over if you have something to make this better (even as a draft). Thanks!