Skip to content

Commit a66bd11

Browse files
authored
Add docs about packaging kernels (#1013)
1 parent 4ffbfcf commit a66bd11

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

docs/kernels.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,20 @@ To start the terminal console or the Qt console with a specific kernel::
184184

185185
The notebook offers you the available kernels in a dropdown menu from the 'New'
186186
button.
187+
188+
189+
.. _packaging-kernels:
190+
191+
Packaging
192+
=========
193+
194+
To release your kernel as a Python package, we recommend following the pattern
195+
used in the :ref:`echo_kernel`, which uses the `hatch`_ build backend and
196+
a build file that creates the kernel directory with the ``kernel.json`` and
197+
kernel icons, which is included as ``shared-data``, ending up in the
198+
``share/jupyter/kernels/`` folder in the user's installed environment.
199+
See `pyproject.toml`_ and `hatch_build.py`_ for more details.
200+
201+
.. _hatch: https://hatch.pypa.io/latest/
202+
.. _pyproject.toml: https://github.com/jupyter/echo_kernel/blob/main/pyproject.toml
203+
.. _hatch_build.py: https://github.com/jupyter/echo_kernel/blob/main/hatch_build.py

docs/wrapperkernels.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ also has a ``ProcessKernel`` subclass that makes it easy to write kernels that
1919
use ``pexpect``.
2020
See `Octave Kernel <https://github.com/Calysto/octave_kernel>`_ as an example.
2121

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

2324
Required steps
2425
--------------
@@ -86,7 +87,7 @@ Example
8687

8788
.. seealso::
8889

89-
`echo_kernel <https://github.com/jupyter/echo_kernel>`__
90+
`echo_kernel <https://github.com/jupyter/echo_kernel>`_
9091
A packaged, installable version of the condensed example below.
9192

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

0 commit comments

Comments
 (0)