This code installs jupyter kernels for different languages into the user space. Once the kernel has been installed it can be used on the jupyter-hub server of DKRZ.
python3 -m pip install jupyter-kernel-install
jupyter-kernel-install --help
Usage: jupyter-kernel-install [-h] [--name NAME] [--display-name DISPLAY_NAME] [--version] language
Install jupyter kernel specs of different languages.
Positional Arguments:
language The programming language
Options:
-h, --help show this help message and exit
--name, -n NAME The name of the kernel (default: None)
--display-name, -d DISPLAY_NAME
The display name of the kernel (default: None)
--version, -V Display version and exit
Alternatively you can use:
python -m jupyter_kernel_install --help
The following kernel specifications are supported:
- python3
- gnuR
- bash
Example for installing a gnuR kernel:
jupyter-kernel-install r --name r-regiklim --display-name "R for Regiklim"
Example for programmatically installing a bash kernel:
import jupyter_kernel_install as ki
kernel_path = ki.bash(name="bash-regiklim", display_name="bash kernel")
Any contributions are welcome. To start developing we recommend creating a new mini conda environment.
conda env create -f environment.yml; conda activate install-kernelspec
Unit tests, building the documentation, type annotations and code style tests are done with tox. To run all tests, linting in parallel simply execute the following command:
tox -p 3
You can also run the each part alone, for example to only check the code style:
tox -e lint
available options are lint
, types
and test
.
Tox runs in a separate python environment to run the tests in the current environment use:
pytest