python.pkgs.jupyter_core: own file, enable tests

This commit is contained in:
Robin Gloster 2017-10-23 12:51:38 +02:00
parent 322fa6b06c
commit 38c04e691c
No known key found for this signature in database
GPG Key ID: D5C458DF6DD97EDF
3 changed files with 63 additions and 26 deletions

View File

@ -0,0 +1,38 @@
{ lib
, python
, buildPythonPackage
, fetchPypi
, ipython
, traitlets
, glibcLocales
, mock
, pytest
}:
buildPythonPackage rec {
pname = "jupyter_core";
version = "4.3.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "a96b129e1641425bf057c3d46f4f44adce747a7d60107e8ad771045c36514d40";
};
buildInputs = [ pytest mock glibcLocales ];
propagatedBuildInputs = [ ipython traitlets ];
patches = [ ./tests_respect_pythonpath.patch ];
checkPhase = ''
mkdir tmp
HOME=tmp TMPDIR=tmp LC_ALL=en_US.utf8 py.test
'';
meta = with lib; {
description = "Jupyter core package. A base package on which Jupyter projects rely";
homepage = http://jupyter.org/;
license = licenses.bsd3;
maintainers = with maintainers; [ fridh globin ];
};
}

View File

@ -0,0 +1,24 @@
--- a/jupyter_core/tests/test_command.py 2016-09-13 15:22:49.000000000 +0200
+++ b/jupyter_core/tests/test_command.py 2017-10-23 12:49:27.489527705 +0200
@@ -113,7 +113,10 @@
witness = a.join(witness_cmd)
witness.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")'))
witness.chmod(0o700)
- out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH': ''})
+ out = check_output(
+ [sys.executable, str(jupyter), 'witness'],
+ env={'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']}
+ )
assert b'WITNESS' in out
@@ -136,5 +139,8 @@
witness_b.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")'))
witness_b.chmod(0o700)
- out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH': str(b)})
+ out = check_output(
+ [sys.executable, str(jupyter), 'witness'],
+ env={'PATH': str(b), 'PYTHONPATH': os.environ['PYTHONPATH']}
+ )
assert b'WITNESS A' in out

View File

@ -10798,32 +10798,7 @@ in {
jupyter_client = callPackage ../development/python-modules/jupyter_client { };
jupyter_core = buildPythonPackage rec {
version = "4.3.0";
name = "jupyter_core-${version}";
src = pkgs.fetchurl {
url = "mirror://pypi/j/jupyter_core/${name}.tar.gz";
sha256 = "a96b129e1641425bf057c3d46f4f44adce747a7d60107e8ad771045c36514d40";
};
buildInputs = with self; [ pytest mock ];
propagatedBuildInputs = with self; [ ipython traitlets];
checkPhase = ''
py.test
'';
# Several tests fail due to being in a chroot
doCheck = false;
meta = {
description = "Jupyter core package. A base package on which Jupyter projects rely";
homepage = http://jupyter.org/;
license = licenses.bsd3;
maintainers = with maintainers; [ fridh ];
};
};
jupyter_core = callPackage ../development/python-modules/jupyter_core { };
jsonpath_rw = buildPythonPackage rec {
name = "jsonpath-rw-${version}";