nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

bash-kernel: fix and add smoke test

authored by

thomasjm and committed by
Matthieu Coudron
1a53d626 05789ac1

+42 -4
+16 -4
pkgs/development/python-modules/bash-kernel/default.nix
··· 6 6 , ipykernel 7 7 , python 8 8 , pexpect 9 - , bash 9 + , bashInteractive 10 10 , substituteAll 11 11 }: 12 12 ··· 24 24 patches = [ 25 25 (substituteAll { 26 26 src = ./bash-path.patch; 27 - bash = lib.getExe bash; 27 + bash = lib.getExe bashInteractive; 28 28 }) 29 29 ]; 30 30 ··· 45 45 ${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out 46 46 ''; 47 47 48 - # no tests 49 - doCheck = false; 48 + checkPhase = '' 49 + runHook preCheck 50 + 51 + # Create a JUPYTER_PATH with the kernelspec 52 + export JUPYTER_PATH=$(mktemp -d) 53 + mkdir -p $JUPYTER_PATH/kernels/bash 54 + echo '{ "language": "bash", "argv": [ "${python}/bin/python", "-m", "bash_kernel", "-f", "{connection_file}" ] }' > $JUPYTER_PATH/kernels/bash/kernel.json 55 + 56 + # Evaluate a test notebook with papermill 57 + cd $(mktemp -d) 58 + ${python.withPackages (ps: [ps.papermill])}/bin/papermill --kernel bash ${./test.ipynb} out.ipynb 59 + 60 + runHook postCheck 61 + ''; 50 62 51 63 meta = with lib; { 52 64 description = "Bash Kernel for Jupyter";
+26
pkgs/development/python-modules/bash-kernel/test.ipynb
··· 1 + { 2 + "cells": [ 3 + { 4 + "cell_type": "code", 5 + "execution_count": null, 6 + "metadata": {}, 7 + "outputs": [], 8 + "source": [ 9 + "echo hi" 10 + ] 11 + } 12 + ], 13 + "metadata": { 14 + "kernel_info": { 15 + "display_name": "Unknown", 16 + "name": "bash" 17 + }, 18 + "language_info": { 19 + "file_extension": ".ipynb", 20 + "name": "bash", 21 + "version": "5.0" 22 + } 23 + }, 24 + "nbformat": 4, 25 + "nbformat_minor": 2 26 + }