summary refs log tree commit diff
path: root/pkgs/development/python-modules/notebook-shim/default.nix
blob: 3bdb11416863b0da27aa80d576bfe98b70959e72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, jupyter-server
, pytestCheckHook
, pytest-tornasync
}:

buildPythonPackage rec {
  pname = "notebook-shim";
  version = "0.2.3";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "jupyter";
    repo = "notebook_shim";
    rev = "refs/tags/v${version}";
    hash = "sha256-eAYZuNYqOMKC6joDbbKk4Q4nrfdbO7b+yZeSvMdWWrI=";
  };

  nativeBuildInputs = [ hatchling ];
  propagatedBuildInputs = [ jupyter-server ];

  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;

  nativeCheckInputs = [
    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 ];
  };
}