jupyter-server / extension-cookiecutter Goto Github PK
View Code? Open in Web Editor NEWA Cookiecutter recipe for Jupyter Server extensions
License: BSD 3-Clause "New" or "Revised" License
A Cookiecutter recipe for Jupyter Server extensions
License: BSD 3-Clause "New" or "Revised" License
Current jupyter server documentation doesn't have any references for using a config/trait in the extension app. This forces extension writers to use alternate means to configure their applications by using env variables or other custom configuration methods.
Add a trait/config to the extension app that showcases use of config to set properties with default values but configurable from the extension config. Also add code to show use of this trait within a handler.
I ran through the setup process with cookiecutter to generate my sample extension but I'm not understanding how to test it within a running jupyter server. My (naive) understanding was that this extension just adds a /ping
endpoint to the server that responds with a 200 and 'pong', but I'm either misunderstanding the code, or missing something.
The server extension does appear to load correctly judging from the logs below
cookiecutter https://github.com/jupyter-server/extension-cookiecutter
pip install .
jupyter server
I expected to be able to curl http://localhost:8888/myextension/ping
but that returned a 404 instead of "pong"
Paste the output from running `jupyter troubleshoot` from the command line here. You may want to sanitize the paths in the output.
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Paste the output from your browser Javascript console here, if applicable.
Currently we are using a top level url (/ping
) in the recipe. It should be namespaced with the extension name, to promote best practices.
Maybe we can add some unit test templates
Just like https://github.com/jupyter-server/jupyter_server/tree/main/examples/simple/tests
And pytest config like
https://github.com/jupyter-server/jupyter_server/blob/main/examples/simple/pytest.ini
https://github.com/jupyter-server/jupyter_server/blob/main/examples/simple/conftest.py
We should use jupyter_server.pytest_plugin
and create a simple test file.
For an example see,
https://github.com/jupyter-server/jupyter_server/blob/main/examples/simple/conftest.py
https://github.com/jupyter-server/jupyter_server/blob/main/examples/simple/tests/test_handlers.py
We would need to add a test dependency on jupyter_server[test]
in pyproject.toml
, e.g.
[project.optional-dependencies]
tests = [
'pytest',
'jupyter_server[test]`
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.