Merge pull request #30762 from mayflower/jupyter-update

Update jupyter and enable a few tests
This commit is contained in:
Frederik Rietdijk 2017-10-25 19:54:55 +02:00 committed by GitHub
commit 316f4ac994
8 changed files with 156 additions and 68 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

@ -0,0 +1,24 @@
{ lib
, buildPythonPackage
, fetchPypi
, nose
}:
buildPythonPackage rec {
pname = "mistune";
version = "0.7.4";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "0byj9jg9ly7karf5sb1aqcw7avaim9sxl8ws7yw7p1fibjgsy5w5";
};
buildInputs = [ nose ];
meta = with lib; {
description = "The fastest markdown parser in pure Python";
homepage = https://github.com/lepture/mistune;
license = licenses.bsd3;
};
}

View File

@ -3,6 +3,7 @@
, fetchPypi
, pytest
, nose
, glibcLocales
, entrypoints
, bleach
, mistune
@ -21,15 +22,15 @@
buildPythonPackage rec {
pname = "nbconvert";
version = "5.2.1";
version = "5.3.1";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "9ed68ec7fe90a8672b43795b29ea91cc75ea355c83debc83ebd12171521ec274";
sha256 = "1f9dkvpx186xjm4xab0qbph588mncp4vqk3fmxrsnqs43mks9c8j";
};
checkInputs = [ nose pytest ];
checkInputs = [ nose pytest glibcLocales ];
propagatedBuildInputs = [
entrypoints bleach mistune jinja2 pygments traitlets testpath
@ -37,16 +38,14 @@ buildPythonPackage rec {
];
checkPhase = ''
nosetests -v
mkdir tmp
LC_ALL=en_US.utf8 HOME=`realpath tmp` py.test -v
'';
# PermissionError. Likely due to being in a chroot
doCheck = false;
meta = {
description = "Converting Jupyter Notebooks";
homepage = http://jupyter.org/;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ fridh ];
maintainers = with lib.maintainers; [ fridh globin ];
};
}

View File

@ -19,18 +19,21 @@ buildPythonPackage rec {
inherit pname version;
sha256 = "f7494ef0df60766b7cabe0a3651556345a963b74dbc16bc7c18479041170d402";
};
LC_ALL="en_US.UTF-8";
LC_ALL="en_US.utf8";
checkInputs = [ pytest glibcLocales ];
propagatedBuildInputs = [ ipython_genutils traitlets testpath jsonschema jupyter_core ];
# Failing tests and permission issues
doCheck = false;
preCheck = ''
mkdir tmp
export HOME=tmp
'';
meta = {
description = "The Jupyter Notebook format";
homepage = http://jupyter.org/;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ fridh ];
maintainers = with lib.maintainers; [ fridh globin ];
};
}

View File

@ -0,0 +1,31 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
, nose
}:
buildPythonPackage rec {
pname = "nose_warnings_filters";
version = "0.1.5";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "17dvfqfy2fm7a5cmiffw2dc3064kpx72fn5mlw01skm2rhn5nv25";
};
disabled = !isPy3k;
propagatedBuildInputs = [ nose ];
checkPhase = ''
nosetests -v
'';
meta = {
description = "Allow injecting warning filters during nosetest";
homepage = https://github.com/Carreau/nose_warnings_filters;
license = lib.licenses.mit;
};
}

View File

@ -2,8 +2,9 @@
, buildPythonPackage
, fetchPypi
, nose
, nose_warnings_filters
, glibcLocales
, isPy27
, isPy3k
, mock
, jinja2
, tornado
@ -21,32 +22,39 @@
buildPythonPackage rec {
pname = "notebook";
version = "5.0.0";
version = "5.2.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "1cea3bbbd03c8e5842a1403347a8cc8134486b3ce081a2e5b1952a00ea66ed54";
sha256 = "1sh3jkkmjzv17c3r8ii3kfhpxi6dkjk846b2lfy71g9qwqdcvbvz";
};
LC_ALL = "en_US.UTF-8";
LC_ALL = "en_US.utf8";
buildInputs = [nose glibcLocales] ++ lib.optionals isPy27 [mock];
buildInputs = [ nose glibcLocales ]
++ (if isPy3k then [ nose_warnings_filters ] else [ mock ]);
propagatedBuildInputs = [jinja2 tornado ipython_genutils traitlets jupyter_core
jupyter_client nbformat nbconvert ipykernel terminado requests pexpect ];
propagatedBuildInputs = [
jinja2 tornado ipython_genutils traitlets jupyter_core
jupyter_client nbformat nbconvert ipykernel terminado requests pexpect
];
# disable warning_filters
preCheck = lib.optionalString (!isPy3k) ''
echo "" > setup.cfg
cat setup.cfg
'';
checkPhase = ''
nosetests -v
runHook preCheck
mkdir tmp
HOME=tmp nosetests -v
'';
# Certain tests fail due to being in a chroot.
# PermissionError
doCheck = false;
meta = {
description = "The Jupyter HTML notebook is a web-based notebook environment for interactive computing";
homepage = http://jupyter.org/;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ fridh ];
maintainers = with lib.maintainers; [ fridh globin ];
};
}
}

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}";
@ -11902,23 +11877,7 @@ in {
};
};
mistune = buildPythonPackage rec {
version = "0.7.1";
name = "mistune-${version}";
src = pkgs.fetchurl {
url = "mirror://pypi/m/mistune/${name}.tar.gz";
sha256 = "6076dedf768348927d991f4371e5a799c6a0158b16091df08ee85ee231d929a7";
};
buildInputs = with self; [nose];
meta = {
description = "The fastest markdown parser in pure Python";
homepage = https://github.com/lepture/mistune;
license = licenses.bsd3;
};
};
mistune = callPackage ../development/python-modules/mistune { };
brotlipy = buildPythonPackage rec {
name = "brotlipy-${version}";
@ -13151,6 +13110,8 @@ in {
buildInputs = with self; [ nose ];
};
nose_warnings_filters = callPackage ../development/python-modules/nose_warnings_filters { };
notebook = callPackage ../development/python-modules/notebook { };
notify = pkgs.stdenv.mkDerivation (rec {