python3Packages.jupyter_core: fix tests

This commit is contained in:
Jonathan Ringer 2022-03-07 18:28:39 -08:00 committed by Martin Weinelt
parent c03cd2675f
commit aaf28be7d0

View file

@ -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/";