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 00000000000..fe40a3f09c4 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/jupyter_core/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchPypi +, ipython +, traitlets +, glibcLocales +, mock +, pytest +, nose +}: + +buildPythonPackage rec { + pname = "jupyter_core"; + version = "4.6.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "394fd5dd787e7c8861741880bdf8a00ce39f95de5d18e579c74b882522219e7e"; + }; + + checkInputs = [ pytest mock glibcLocales nose ]; + propagatedBuildInputs = [ ipython traitlets ]; + + patches = [ ./tests_respect_pythonpath.patch ]; + + checkPhase = '' + HOME=$TMPDIR LC_ALL=en_US.utf8 py.test + ''; + + meta = with lib; { + description = "Jupyter core package. A base package on which Jupyter projects rely"; + homepage = "https://jupyter.org/"; + license = licenses.bsd3; + maintainers = with maintainers; [ fridh ]; + }; +} 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 00000000000..7e7e9ae93a0 --- /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': |