diff --git a/pkgs/development/python-modules/jupyter_core/default.nix b/pkgs/development/python-modules/jupyter_core/default.nix index e093706fa8e1..b7838ff5915f 100644 --- a/pkgs/development/python-modules/jupyter_core/default.nix +++ b/pkgs/development/python-modules/jupyter_core/default.nix @@ -2,11 +2,13 @@ , buildPythonPackage , fetchPypi , isPy3k +, fetchpatch +, python , ipython , traitlets , glibcLocales , mock -, pytest +, pytestCheckHook , nose }: @@ -20,15 +22,34 @@ buildPythonPackage rec { sha256 = "sha256-1puuuf+xKLjNJlf88nA/icdp0Wc8hRgSEZ46Kg6TrZo="; }; - checkInputs = [ pytest mock glibcLocales nose ]; + checkInputs = [ pytestCheckHook mock glibcLocales nose ]; propagatedBuildInputs = [ ipython traitlets ]; - patches = [ ./tests_respect_pythonpath.patch ]; + patches = [ + # install jupyter_core/*.py files + (fetchpatch { + url = "https://github.com/jupyter/jupyter_core/pull/253/commits/3bbeaebec0a53520523162d5e8d5c6ca02b1b782.patch"; + sha256 = "sha256-QeAfj7wLz4egVUPMAgrZ9Wn/Tv60LrIXLgHGVoH41wQ="; + }) + ./tests_respect_pythonpath.patch + ]; - checkPhase = '' - HOME=$TMPDIR LC_ALL=en_US.utf8 py.test + preCheck = '' + export HOME=$TMPDIR + export LC_ALL=en_US.utf8 ''; + disabledTests = [ + # creates a temporary script, which isn't aware of PYTHONPATH + "test_argv0" + ]; + + postCheck = '' + $out/bin/jupyter --help > /dev/null + ''; + + pythonImportsCheck = [ "jupyter_core" ]; + meta = with lib; { description = "Jupyter core package. A base package on which Jupyter projects rely"; homepage = "https://jupyter.org/";