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

Add docs about packaging kernels #1013

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/kernels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,20 @@ To start the terminal console or the Qt console with a specific kernel::

The notebook offers you the available kernels in a dropdown menu from the 'New'
button.


.. _packaging-kernels:

Packaging
=========

To release your kernel as a Python package, we recommend following the pattern
used in the :ref:`echo_kernel`, which uses the `hatch`_ build backend and
a build file that creates the kernel directory with the ``kernel.json`` and
kernel icons, which is included as ``shared-data``, ending up in the
``share/jupyter/kernels/`` folder in the user's installed environment.
See `pyproject.toml`_ and `hatch_build.py`_ for more details.

.. _hatch: https://hatch.pypa.io/latest/
.. _pyproject.toml: https://github.com/jupyter/echo_kernel/blob/main/pyproject.toml
.. _hatch_build.py: https://github.com/jupyter/echo_kernel/blob/main/hatch_build.py
3 changes: 2 additions & 1 deletion docs/wrapperkernels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ also has a ``ProcessKernel`` subclass that makes it easy to write kernels that
use ``pexpect``.
See `Octave Kernel <https://github.com/Calysto/octave_kernel>`_ as an example.

If releasing a wrapper kernel as a Python package, see the steps in :ref:`packaging-kernels`.

Required steps
--------------
Expand Down Expand Up @@ -86,7 +87,7 @@ Example

.. seealso::

`echo_kernel <https://github.com/jupyter/echo_kernel>`__
`echo_kernel <https://github.com/jupyter/echo_kernel>`_
A packaged, installable version of the condensed example below.

``echokernel.py`` will simply echo any input it's given to stdout::
Expand Down
Loading