2022-08-14 20:04:28 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-01-15 04:21:31 +00:00
|
|
|
, hatchling
|
2023-01-04 23:48:20 +00:00
|
|
|
, jupyter-server
|
2022-08-14 20:04:28 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-tornasync
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "notebook-shim";
|
2022-12-30 19:13:28 +00:00
|
|
|
version = "0.2.2";
|
2023-01-15 04:21:31 +00:00
|
|
|
format = "pyproject";
|
2022-08-14 20:04:28 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupyter";
|
|
|
|
repo = "notebook_shim";
|
2022-12-30 19:13:28 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-/z4vXSBqeL2wSqJ0kFNgU0TSGUGByhxHNya8EO55+7s=";
|
2022-08-14 20:04:28 +00:00
|
|
|
};
|
|
|
|
|
2023-01-15 04:21:31 +00:00
|
|
|
nativeBuildInputs = [ hatchling ];
|
2023-01-04 23:48:20 +00:00
|
|
|
propagatedBuildInputs = [ jupyter-server ];
|
2022-08-14 20:04:28 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
mv notebook_shim/conftest.py notebook_shim/tests
|
|
|
|
cd notebook_shim/tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: understand & possibly fix why tests fail. On github most testfiles
|
|
|
|
# have been comitted with msgs "wip" though.
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-14 20:04:28 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-tornasync
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "notebook_shim" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Switch frontends to Jupyter Server";
|
|
|
|
longDescription = ''
|
|
|
|
This project provides a way for JupyterLab and other frontends to switch
|
|
|
|
to Jupyter Server for their Python Web application backend.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/jupyter/notebook_shim";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ friedelino ];
|
|
|
|
};
|
|
|
|
}
|