diff options
author | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2017-10-25 19:54:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-25 19:54:55 +0200 |
commit | 316f4ac9946e628eca26bcff21fbcedd7b53e510 (patch) | |
tree | 7c45465502bbbf13e16bf2228ac8390543ae58b1 /pkgs/development | |
parent | 6a768082fdb998e8fdb608eceefef2d6db950518 (diff) | |
parent | 54a83423f015fc4a8682d76fdc97c3cb16da11dc (diff) | |
download | nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.tar nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.tar.gz nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.tar.bz2 nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.tar.lz nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.tar.xz nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.tar.zst nixlib-316f4ac9946e628eca26bcff21fbcedd7b53e510.zip |
Merge pull request #30762 from mayflower/jupyter-update
Update jupyter and enable a few tests
Diffstat (limited to 'pkgs/development')
7 files changed, 152 insertions, 25 deletions
diff --git a/pkgs/development/python-modules/jupyter_core/default.nix b/pkgs/development/python-modules/jupyter_core/default.nix new file mode 100644 index 000000000000..4db36cf7b374 --- /dev/null +++ b/pkgs/development/python-modules/jupyter_core/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch b/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch new file mode 100644 index 000000000000..61415b756abc --- /dev/null +++ b/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch @@ -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 diff --git a/pkgs/development/python-modules/mistune/default.nix b/pkgs/development/python-modules/mistune/default.nix new file mode 100644 index 000000000000..14aef5b00d12 --- /dev/null +++ b/pkgs/development/python-modules/mistune/default.nix @@ -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; + }; +} diff --git a/pkgs/development/python-modules/nbconvert/default.nix b/pkgs/development/python-modules/nbconvert/default.nix index 881895ba6baa..d04e5c5eccbd 100644 --- a/pkgs/development/python-modules/nbconvert/default.nix +++ b/pkgs/development/python-modules/nbconvert/default.nix @@ -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 ]; }; } diff --git a/pkgs/development/python-modules/nbformat/default.nix b/pkgs/development/python-modules/nbformat/default.nix index 6f637bae891b..71a140e53255 100644 --- a/pkgs/development/python-modules/nbformat/default.nix +++ b/pkgs/development/python-modules/nbformat/default.nix @@ -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 ]; }; } diff --git a/pkgs/development/python-modules/nose_warnings_filters/default.nix b/pkgs/development/python-modules/nose_warnings_filters/default.nix new file mode 100644 index 000000000000..db53a34a57f3 --- /dev/null +++ b/pkgs/development/python-modules/nose_warnings_filters/default.nix @@ -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; + }; +} diff --git a/pkgs/development/python-modules/notebook/default.nix b/pkgs/development/python-modules/notebook/default.nix index 3a24c5566bf0..c30e6e5e77d6 100644 --- a/pkgs/development/python-modules/notebook/default.nix +++ b/pkgs/development/python-modules/notebook/default.nix @@ -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 ]; }; -} \ No newline at end of file +} |