diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/jupyter_core')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/jupyter_core/default.nix | 36 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch | 20 |
2 files changed, 56 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/jupyter_core/default.nix b/nixpkgs/pkgs/development/python-modules/jupyter_core/default.nix new file mode 100644 index 000000000000..a6a955507a79 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/jupyter_core/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchPypi +, ipython +, traitlets +, glibcLocales +, mock +, pytest +}: + +buildPythonPackage rec { + pname = "jupyter_core"; + version = "4.4.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "ba70754aa680300306c699790128f6fbd8c306ee5927976cbe48adacf240c0b7"; + }; + + checkInputs = [ 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/nixpkgs/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch b/nixpkgs/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch new file mode 100644 index 000000000000..7e7e9ae93a09 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch @@ -0,0 +1,20 @@ +--- a/jupyter_core/tests/test_command.py ++++ b/jupyter_core/tests/test_command.py +@@ -131,7 +131,7 @@ def test_not_on_path(tmpdir): + witness_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")') + write_executable(witness, witness_src) + +- env = {'PATH': ''} ++ env = {'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']} + if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614 + env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT'] + if sys.platform == 'win32': +@@ -157,7 +157,7 @@ def test_path_priority(tmpdir): + witness_b_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")') + write_executable(witness_b, witness_b_src) + +- env = {'PATH': str(b)} ++ env = {'PATH': str(b), 'PYTHONPATH': os.environ['PYTHONPATH']} + if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614 + env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT'] + if sys.platform == 'win32': |