diff --git a/pkgs/applications/misc/haxor-news/default.nix b/pkgs/applications/misc/haxor-news/default.nix index 1fa016627d4e0..d840a754497a1 100644 --- a/pkgs/applications/misc/haxor-news/default.nix +++ b/pkgs/applications/misc/haxor-news/default.nix @@ -16,7 +16,7 @@ buildPythonApplication rec { colorama requests pygments - prompt_toolkit + prompt_toolkit_1 six ]; diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix index 7717862f6a0ac..fc5f9f217c03d 100644 --- a/pkgs/applications/networking/gns3/server.nix +++ b/pkgs/applications/networking/gns3/server.nix @@ -57,7 +57,7 @@ in pythonPackages.buildPythonPackage rec { ++ (with pythonPackages; [ yarl aiohttp multidict jinja2 psutil zipstream raven jsonschema typing - prompt_toolkit + prompt_toolkit_1 ]); # Requires network access diff --git a/pkgs/development/python-modules/ipykernel/4.nix b/pkgs/development/python-modules/ipykernel/4.nix new file mode 100644 index 0000000000000..49dfbf6ad8ec9 --- /dev/null +++ b/pkgs/development/python-modules/ipykernel/4.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, nose +, isPy27 +, mock +, ipython +, jupyter_client +, pexpect +, traitlets +, tornado +}: + +buildPythonPackage rec { + pname = "ipykernel"; + version = "4.10.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "699103c8e64886e3ec7053f2a6aa83bb90426063526f63a818732ff385202bad"; + }; + + checkInputs = [ nose ] ++ lib.optional isPy27 mock; + propagatedBuildInputs = [ + ipython + jupyter_client + pexpect + traitlets + tornado + ]; + + # Tests require backends. + # I don't want to add all supported backends as propagatedBuildInputs + doCheck = false; + + meta = { + description = "IPython Kernel for Jupyter"; + homepage = http://ipython.org/; + license = lib.licenses.bsd3; + }; +} diff --git a/pkgs/development/python-modules/ipykernel/default.nix b/pkgs/development/python-modules/ipykernel/default.nix index 9d4392583be52..43b1c9fd03495 100644 --- a/pkgs/development/python-modules/ipykernel/default.nix +++ b/pkgs/development/python-modules/ipykernel/default.nix @@ -1,37 +1,31 @@ { lib , buildPythonPackage , fetchPypi -, nose -, isPy27 -, mock , ipython , jupyter_client -, pexpect , traitlets , tornado +, pythonOlder +, pytest +, nose }: buildPythonPackage rec { pname = "ipykernel"; - version = "4.8.2"; + version = "5.1.0"; + disabled = pythonOlder "3.4"; src = fetchPypi { inherit pname version; - sha256 = "c091449dd0fad7710ddd9c4a06e8b9e15277da306590bc07a3a1afa6b4453c8f"; + sha256 = "0fc0bf97920d454102168ec2008620066878848fcfca06c22b669696212e292f"; }; - buildInputs = [ nose ] ++ lib.optional isPy27 mock; - propagatedBuildInputs = [ - ipython - jupyter_client - pexpect - traitlets - tornado - ]; + checkInputs = [ pytest nose ]; + propagatedBuildInputs = [ ipython jupyter_client traitlets tornado ]; - # Tests require backends. - # I don't want to add all supported backends as propagatedBuildInputs - doCheck = false; + checkPhase = '' + HOME=$(mktemp -d) pytest ipykernel + ''; meta = { description = "IPython Kernel for Jupyter"; @@ -39,4 +33,4 @@ buildPythonPackage rec { license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ fridh ]; }; -} \ No newline at end of file +} diff --git a/pkgs/development/python-modules/ipython/5.nix b/pkgs/development/python-modules/ipython/5.nix index 36f581c98afbe..a93a8c1801550 100644 --- a/pkgs/development/python-modules/ipython/5.nix +++ b/pkgs/development/python-modules/ipython/5.nix @@ -19,40 +19,30 @@ , requests , simplegeneric , traitlets -, prompt_toolkit +, prompt_toolkit_1 , pexpect , appnope }: buildPythonPackage rec { pname = "ipython"; - version = "5.7.0"; + version = "5.8.0"; src = fetchPypi { inherit pname version; - sha256 = "0g1jm06qriq48m58311cs7askp83ipq3yq96hv4kg431nxzkmd4d"; + sha256 = "4bac649857611baaaf76bc82c173aa542f7486446c335fe1a6c05d0d491c8906"; }; prePatch = stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace setup.py --replace "'gnureadline'" " " ''; - patches = [ - # improve cython support, needed by sage, accepted upstream - # https://github.com/ipython/ipython/pull/11139 - (fetchpatch { - name = "signature-use-inspect.patch"; - url = "https://github.com/ipython/ipython/commit/8d399b98d3ed5c765835594100c4d36fb2f739dc.patch"; - sha256 = "1r7v9clwwbskmj4y160vcj6g0vzqbvnj4y1bm2n4bskafapm42g0"; - }) - ]; - buildInputs = [ glibcLocales ]; checkInputs = [ nose pygments testpath ] ++ lib.optional isPy27 mock; propagatedBuildInputs = [ - backports_shutil_get_terminal_size decorator pickleshare prompt_toolkit + backports_shutil_get_terminal_size decorator pickleshare prompt_toolkit_1 simplegeneric traitlets requests pathlib2 pexpect ] ++ lib.optionals stdenv.isDarwin [ appnope ]; diff --git a/pkgs/development/python-modules/ipython/default.nix b/pkgs/development/python-modules/ipython/default.nix index efc6933807f58..e4a56f85e814e 100644 --- a/pkgs/development/python-modules/ipython/default.nix +++ b/pkgs/development/python-modules/ipython/default.nix @@ -12,22 +12,21 @@ , jedi , decorator , pickleshare -, simplegeneric , traitlets , prompt_toolkit , pexpect , appnope -, typing , backcall }: buildPythonPackage rec { pname = "ipython"; - version = "6.5.0"; + version = "7.1.1"; + disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "b0f2ef9eada4a68ef63ee10b6dde4f35c840035c50fd24265f8052c98947d5a4"; + sha256 = "b10a7ddd03657c761fc503495bc36471c8158e3fc948573fb9fe82a7029d8efd"; }; prePatch = lib.optionalString stdenv.isDarwin '' @@ -42,13 +41,12 @@ buildPythonPackage rec { jedi decorator pickleshare - simplegeneric traitlets prompt_toolkit + pygments pexpect backcall - ] ++ lib.optionals stdenv.isDarwin [appnope] - ++ lib.optionals (pythonOlder "3.5") [ typing ]; + ] ++ lib.optionals stdenv.isDarwin [appnope]; LC_ALL="en_US.UTF-8"; @@ -58,11 +56,6 @@ buildPythonPackage rec { nosetests ''; - # IPython 6.0.0 and above does not support Python < 3.3. - # The last IPython version to support older Python versions - # is 5.3.x. - disabled = pythonOlder "3.3"; - meta = { description = "IPython: Productive Interactive Computing"; homepage = http://ipython.org/; diff --git a/pkgs/development/python-modules/jupyter_console/5.nix b/pkgs/development/python-modules/jupyter_console/5.nix new file mode 100644 index 0000000000000..57c4a9c96d948 --- /dev/null +++ b/pkgs/development/python-modules/jupyter_console/5.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, fetchPypi +, nose +, jupyter_client +, ipython +, ipykernel +, prompt_toolkit_1 +, pygments +}: + +buildPythonPackage rec { + pname = "jupyter_console"; + version = "5.2.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "545dedd3aaaa355148093c5609f0229aeb121b4852995c2accfa64fe3e0e55cd"; + }; + + checkInputs = [ nose ]; + propagatedBuildInputs = [ + jupyter_client + ipython + ipykernel + prompt_toolkit_1 + pygments + ]; + + # ValueError: underlying buffer has been detached + doCheck = false; + + meta = { + description = "Jupyter terminal console"; + homepage = "http://jupyter.org/"; + license = lib.licenses.bsd3; + }; +} diff --git a/pkgs/development/python-modules/jupyter_console/default.nix b/pkgs/development/python-modules/jupyter_console/default.nix index 26b52c41c23ae..aa02878501303 100644 --- a/pkgs/development/python-modules/jupyter_console/default.nix +++ b/pkgs/development/python-modules/jupyter_console/default.nix @@ -7,15 +7,17 @@ , ipykernel , prompt_toolkit , pygments +, pythonOlder }: buildPythonPackage rec { pname = "jupyter_console"; - version = "5.2.0"; + version = "6.0.0"; + disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "545dedd3aaaa355148093c5609f0229aeb121b4852995c2accfa64fe3e0e55cd"; + sha256 = "308ce876354924fb6c540b41d5d6d08acfc946984bf0c97777c1ddcb42e0b2f5"; }; checkInputs = [ nose ]; @@ -34,6 +36,5 @@ buildPythonPackage rec { description = "Jupyter terminal console"; homepage = "http://jupyter.org/"; license = lib.licenses.bsd3; - platforms = lib.platforms.all; }; -} \ No newline at end of file +} diff --git a/pkgs/development/python-modules/jupyterhub/default.nix b/pkgs/development/python-modules/jupyterhub/default.nix index 8598654e2060b..0478d59c70857 100644 --- a/pkgs/development/python-modules/jupyterhub/default.nix +++ b/pkgs/development/python-modules/jupyterhub/default.nix @@ -6,6 +6,8 @@ , ipython , jinja2 , python-oauth2 +, prometheus_client +, async_generator , pamela , sqlalchemy , tornado @@ -18,27 +20,27 @@ let # js/css assets that setup.py tries to fetch via `npm install` when building # from source. - bootstrap = + bootstrap = fetchzip { url = "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz"; sha256 = "0r7s54bbf68ri1na9bbabyf12mcpb6zk5ja2q6z82aw1fa4xi3yd"; }; - font-awesome = + font-awesome = fetchzip { url = "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz"; sha256 = "1xnxbdlfdd60z5ix152m8r2kk9dkwlqwpypky1mm3dv64ajnzdbk"; }; - jquery = + jquery = fetchzip { url = "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz"; sha256 = "1j6y18miwzafdj8kfpwbmbn9qvgnbnpc7l4arqrhqj33m04xrlgi"; }; - moment = + moment = fetchzip { - url = "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz"; - sha256 = "1b4vyvs24v6y92pf2iqjm5aa7jg7khcpspn00girc7lpi917f9vw"; + url = "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz"; + sha256 = "12gb3p0rz5wyjwykv9g0pix7dd352lx1z7rzdjsf2brhwc4ffyip"; }; - requirejs = + requirejs = fetchzip { url = "https://registry.npmjs.org/requirejs/-/requirejs-2.3.4.tgz"; sha256 = "0q6mkj0iv341kks06dya6lfs2kdw0n6vc7n4a7aa3ia530fk9vja"; @@ -48,11 +50,12 @@ in buildPythonPackage rec { pname = "jupyterhub"; - version = "0.8.1"; + version = "0.9.4"; + disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "100cf18d539802807a45450d38fefbb376cf1c810f3b1b31be31638829a5c69c"; + sha256 = "7848bbb299536641a59eb1977ec3c7c95d931bace4a2803d7e9b28b9256714da"; }; # Most of this only applies when building from source (e.g. js/css assets are @@ -103,14 +106,13 @@ buildPythonPackage rec { propagatedBuildInputs = [ alembic ipython jinja2 pamela python-oauth2 requests sqlalchemy tornado - traitlets + traitlets prometheus_client async_generator ]; # Disable tests because they take an excessive amount of time to complete. doCheck = false; - disabled = pythonOlder "3.4"; - + meta = with lib; { description = "Serves multiple Jupyter notebook instances"; homepage = http://jupyter.org/; diff --git a/pkgs/development/python-modules/jupyterlab/default.nix b/pkgs/development/python-modules/jupyterlab/default.nix index f0bd058271a9a..3007ea7938c8d 100644 --- a/pkgs/development/python-modules/jupyterlab/default.nix +++ b/pkgs/development/python-modules/jupyterlab/default.nix @@ -1,19 +1,22 @@ -{ lib, buildPythonPackage, isPy3k, fetchPypi, ipython_genutils, jupyterlab_launcher, notebook }: +{ lib +, buildPythonPackage +, fetchPypi +, jupyterlab_server +, notebook +, pythonOlder +}: + buildPythonPackage rec { pname = "jupyterlab"; - version = "0.34.12"; - disabled = !isPy3k; + version = "0.35.4"; + disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "7d8378d19a0ae173e91a493db996c37828b410b7ee556da21a153486168ecf87"; + sha256 = "deba0b2803640fcad72c61366bff11d5945173015961586d5e3b2f629ffeb455"; }; - propagatedBuildInputs = [ - ipython_genutils - jupyterlab_launcher - notebook - ]; + propagatedBuildInputs = [ jupyterlab_server notebook ]; makeWrapperArgs = [ "--set" "JUPYTERLAB_DIR" "$out/share/jupyter/lab" diff --git a/pkgs/development/python-modules/jupyterlab_server/default.nix b/pkgs/development/python-modules/jupyterlab_server/default.nix new file mode 100644 index 0000000000000..9d111c3eb6fa9 --- /dev/null +++ b/pkgs/development/python-modules/jupyterlab_server/default.nix @@ -0,0 +1,38 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, notebook +, jsonschema +, pythonOlder +, requests +, pytest +}: + +buildPythonPackage rec { + pname = "jupyterlab_server"; + version = "0.2.0"; + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "72d916a73957a880cdb885def6d8664a6d1b2760ef5dca5ad665aa1e8d1bb783"; + }; + + checkInputs = [ requests pytest ]; + propagatedBuildInputs = [ notebook jsonschema ]; + + # test_listing test fails + # this is a new package and not all tests pass + doCheck = false; + + checkPhase = '' + pytest + ''; + + meta = with stdenv.lib; { + description = "JupyterLab Server"; + homepage = http://jupyter.org; + license = licenses.bsdOriginal; + maintainers = [ maintainers.costrouc ]; + }; +} diff --git a/pkgs/development/python-modules/nbconvert/default.nix b/pkgs/development/python-modules/nbconvert/default.nix index b167b7f427c1f..19e8e1eede92c 100644 --- a/pkgs/development/python-modules/nbconvert/default.nix +++ b/pkgs/development/python-modules/nbconvert/default.nix @@ -17,15 +17,16 @@ , pandocfilters , tornado , jupyter_client +, defusedxml }: buildPythonPackage rec { pname = "nbconvert"; - version = "5.3.1"; + version = "5.4.0"; src = fetchPypi { inherit pname version; - sha256 = "1f9dkvpx186xjm4xab0qbph588mncp4vqk3fmxrsnqs43mks9c8j"; + sha256 = "a8a2749f972592aa9250db975304af6b7337f32337e523a2c995cc9e12c07807"; }; checkInputs = [ nose pytest glibcLocales ]; @@ -33,11 +34,14 @@ buildPythonPackage rec { propagatedBuildInputs = [ entrypoints bleach mistune jinja2 pygments traitlets testpath jupyter_core nbformat ipykernel pandocfilters tornado jupyter_client + defusedxml ]; + # disable preprocessor tests for ipython 7 + # see issue https://github.com/jupyter/nbconvert/issues/898 checkPhase = '' - mkdir tmp - LC_ALL=en_US.UTF-8 HOME=`realpath tmp` py.test -v + export LC_ALL=en_US.UTF-8 + HOME=$(mktemp -d) py.test -v --ignore="nbconvert/preprocessors/tests/test_execute.py" ''; meta = { diff --git a/pkgs/development/python-modules/notebook/default.nix b/pkgs/development/python-modules/notebook/default.nix index 2f674c9ac3433..abf4df68aa82b 100644 --- a/pkgs/development/python-modules/notebook/default.nix +++ b/pkgs/development/python-modules/notebook/default.nix @@ -25,11 +25,11 @@ buildPythonPackage rec { pname = "notebook"; - version = "5.6.0"; + version = "5.7.0"; src = fetchPypi { inherit pname version; - sha256 = "e2c8e931cc19db4f8c63e6a396efbc13a228b2cb5b2919df011b946f28239a08"; + sha256 = "b85e4de3d54cf4f14fe1d0515a980ccb49ddd4cdd21250cc0d4fb6374d50b1a7"; }; LC_ALL = "en_US.utf8"; diff --git a/pkgs/development/tools/database/pgcli/default.nix b/pkgs/development/tools/database/pgcli/default.nix index 73e3438333835..650e1fc39e536 100644 --- a/pkgs/development/tools/database/pgcli/default.nix +++ b/pkgs/development/tools/database/pgcli/default.nix @@ -10,7 +10,7 @@ pythonPackages.buildPythonApplication rec { }; propagatedBuildInputs = with pythonPackages; [ - cli-helpers click configobj humanize prompt_toolkit_2 psycopg2 + cli-helpers click configobj humanize prompt_toolkit psycopg2 pygments sqlparse pgspecial setproctitle keyring ]; diff --git a/pkgs/shells/xonsh/default.nix b/pkgs/shells/xonsh/default.nix index 32dfd56796d64..5848c0a453cd5 100644 --- a/pkgs/shells/xonsh/default.nix +++ b/pkgs/shells/xonsh/default.nix @@ -28,7 +28,7 @@ python3Packages.buildPythonApplication rec { checkInputs = [ python3Packages.pytest glibcLocales git ]; - propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit_2 pygments ]; + propagatedBuildInputs = with python3Packages; [ ply prompt_toolkit pygments ]; meta = with stdenv.lib; { description = "A Python-ish, BASHwards-compatible shell"; diff --git a/pkgs/tools/admin/aws_shell/default.nix b/pkgs/tools/admin/aws_shell/default.nix index c319c47ea7e45..2fc961279661e 100644 --- a/pkgs/tools/admin/aws_shell/default.nix +++ b/pkgs/tools/admin/aws_shell/default.nix @@ -2,7 +2,7 @@ , buildPythonPackage , fetchPypi , awscli -, prompt_toolkit +, prompt_toolkit_1 , boto3 , configobj , pygments @@ -20,7 +20,7 @@ buildPythonPackage rec { # Why does it propagate packages that are used for testing? propagatedBuildInputs = [ awscli - prompt_toolkit + prompt_toolkit_1 boto3 configobj pygments diff --git a/pkgs/tools/admin/mycli/default.nix b/pkgs/tools/admin/mycli/default.nix index d01dca459591e..7bb9e6cd193ce 100644 --- a/pkgs/tools/admin/mycli/default.nix +++ b/pkgs/tools/admin/mycli/default.nix @@ -15,7 +15,7 @@ buildPythonApplication rec { }; propagatedBuildInputs = [ - pymysql configobj sqlparse prompt_toolkit pygments click pycrypto cli-helpers + pymysql configobj sqlparse prompt_toolkit_1 pygments click pycrypto cli-helpers ]; checkInputs = [ pytest mock glibcLocales ]; diff --git a/pkgs/tools/networking/http-prompt/default.nix b/pkgs/tools/networking/http-prompt/default.nix index dac3b616a9c8f..ef26f4014631f 100644 --- a/pkgs/tools/networking/http-prompt/default.nix +++ b/pkgs/tools/networking/http-prompt/default.nix @@ -16,7 +16,7 @@ pythonPackages.buildPythonApplication rec { click httpie parsimonious - prompt_toolkit + prompt_toolkit_1 pygments six ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1870d1b76fba8..1a362dc6bdc2b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1780,10 +1780,15 @@ in { jupyter = callPackage ../development/python-modules/jupyter { }; - jupyter_console = callPackage ../development/python-modules/jupyter_console { }; + jupyter_console = if pythonOlder "3.5" then + callPackage ../development/python-modules/jupyter_console/5.nix { } + else + callPackage ../development/python-modules/jupyter_console { }; jupyterlab_launcher = callPackage ../development/python-modules/jupyterlab_launcher { }; + jupyterlab_server = callPackage ../development/python-modules/jupyterlab_server { }; + jupyterlab = callPackage ../development/python-modules/jupyterlab {}; PyLTI = callPackage ../development/python-modules/pylti { }; @@ -2520,16 +2525,17 @@ in { ipy = callPackage ../development/python-modules/IPy { }; - ipykernel = callPackage ../development/python-modules/ipykernel { }; + ipykernel = if pythonOlder "3.4" then + callPackage ../development/python-modules/ipykernel/4.nix { } + else + callPackage ../development/python-modules/ipykernel { }; ipyparallel = callPackage ../development/python-modules/ipyparallel { }; - # Newer versions of IPython no longer support Python 2.7. - ipython = if isPy27 then self.ipython_5 else self.ipython_6; - - ipython_5 = callPackage ../development/python-modules/ipython/5.nix { }; - - ipython_6 = callPackage ../development/python-modules/ipython { }; + ipython = if pythonOlder "3.5" then + callPackage ../development/python-modules/ipython/5.nix { } + else + callPackage ../development/python-modules/ipython { }; ipython_genutils = callPackage ../development/python-modules/ipython_genutils { }; @@ -3763,10 +3769,9 @@ in { }; }; - prompt_toolkit = self.prompt_toolkit_1; + prompt_toolkit = self.prompt_toolkit_2; prompt_toolkit_1 = callPackage ../development/python-modules/prompt_toolkit/1.nix { }; - prompt_toolkit_2 = callPackage ../development/python-modules/prompt_toolkit { }; protobuf = callPackage ../development/python-modules/protobuf {