Skip to content

Commit

Permalink
Add docs about packaging kernels (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Mar 4, 2024
1 parent 4ffbfcf commit a66bd11
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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

0 comments on commit a66bd11

Please sign in to comment.