Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions pkgs/development/python-modules/nbclassic/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, python
, fetchPypi
, notebook
, notebook-shim
, pythonOlder
, jupyter_server
, pytestCheckHook
Expand All @@ -14,23 +14,13 @@ buildPythonPackage rec {
version = "0.4.3";
disabled = pythonOlder "3.6";

# tests only on github
src = fetchFromGitHub {
owner = "jupyterlab";
repo = pname;
rev = "refs/tags/v${version}";
sha256 = "sha256-5sof5EOqzK7kNHSXp7eJl3ZagZRWF74e08ahqJId2Z8=";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-8DERss66ppuINwp7I7GbKzfJu3F2fxgozf16BH6ujt0=";
};

propagatedBuildInputs = [ jupyter_server notebook ];
propagatedBuildInputs = [ jupyter_server notebook notebook-shim ];

preCheck = ''
cd nbclassic
mv conftest.py tests
cd tests

export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
'';
checkInputs = [
pytestCheckHook
pytest-tornasync
Expand Down
48 changes: 48 additions & 0 deletions pkgs/development/python-modules/notebook-shim/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, jupyter_server
, pytestCheckHook
, pytest-tornasync
}:

buildPythonPackage rec {
pname = "notebook-shim";
version = "0.1.0";

src = fetchFromGitHub {
owner = "jupyter";
repo = "notebook_shim";
rev = "v${version}";
sha256 = "sha256-5oIYj8SdC4E0N/yFxsmD2p4VkStHvqrVqAwb/htyPm4=";
};

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;

checkInputs = [
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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6085,6 +6085,8 @@ in {

notebook = callPackage ../development/python-modules/notebook { };

notebook-shim = callPackage ../development/python-modules/notebook-shim { };

notedown = callPackage ../development/python-modules/notedown { };

notifications-python-client = callPackage ../development/python-modules/notifications-python-client { };
Expand Down