From 66675b5650b63e2aecd4ceef4d34f1a1d56b9c95 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Wed, 22 Jan 2020 00:39:54 +0100 Subject: [PATCH] python2.pkgs.ipython: use the proper python2 lexer Since pygments 2.5 `PythonLexer` refers to python3 [1]. We have to be explicit if we want to use python2. [1] https://pygments.org/docs/changelog/ --- pkgs/development/python-modules/ipython/5.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/python-modules/ipython/5.nix b/pkgs/development/python-modules/ipython/5.nix index 15e7d00bcece..dd0c97fc3c56 100644 --- a/pkgs/development/python-modules/ipython/5.nix +++ b/pkgs/development/python-modules/ipython/5.nix @@ -2,6 +2,7 @@ , stdenv , buildPythonPackage , fetchPypi +, fetchpatch # Build dependencies , glibcLocales # Test dependencies @@ -36,6 +37,15 @@ buildPythonPackage rec { substituteInPlace setup.py --replace "'gnureadline'" " " ''; + patches = [ + # Use the proper pygments lexer for python2 (https://github.com/ipython/ipython/pull/12095) + (fetchpatch { + name = "python2-lexer.patch"; + url = "https://github.com/ipython/ipython/pull/12095/commits/8805293b5e4bce9150cc2ad9c5d6d984849ae447.patch"; + sha256 = "16p4gl7a49v76w33j39ih7yspy6x2d14p9bh4wdpg9cafhw9nbc0"; + }) + ]; + buildInputs = [ glibcLocales ]; checkInputs = [ nose pygments testpath ] ++ lib.optional isPy27 mock;