From 90157969cf10699f9a65077fb709b8935b2612f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 4 May 2022 19:06:43 +0200 Subject: [PATCH] python310Packages.pygments: adopt, enable tests --- .../python-modules/Pygments/default.nix | 28 ----------- .../python-modules/pygments/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 47 insertions(+), 29 deletions(-) delete mode 100644 pkgs/development/python-modules/Pygments/default.nix create mode 100644 pkgs/development/python-modules/pygments/default.nix diff --git a/pkgs/development/python-modules/Pygments/default.nix b/pkgs/development/python-modules/Pygments/default.nix deleted file mode 100644 index af125e1f40ef..000000000000 --- a/pkgs/development/python-modules/Pygments/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib -, buildPythonPackage -, fetchPypi -, docutils -}: - -buildPythonPackage rec { - pname = "Pygments"; - version = "2.11.2"; - - src = fetchPypi { - inherit pname version; - sha256 = "4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"; - }; - - propagatedBuildInputs = [ docutils ]; - - # Circular dependency with sphinx - doCheck = false; - pythonImportsCheck = [ "pygments" ]; - - meta = { - homepage = "https://pygments.org/"; - description = "A generic syntax highlighter"; - license = lib.licenses.bsd2; - maintainers = with lib.maintainers; [ ]; - }; -} diff --git a/pkgs/development/python-modules/pygments/default.nix b/pkgs/development/python-modules/pygments/default.nix new file mode 100644 index 000000000000..6ab6cec42959 --- /dev/null +++ b/pkgs/development/python-modules/pygments/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchPypi +, docutils +, lxml +, pytestCheckHook +, wcag-contrast-ratio +}: + +let pygments = buildPythonPackage + rec { + pname = "pygments"; + version = "2.11.2"; + + src = fetchPypi { + pname = "Pygments"; + inherit version; + sha256 = "4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"; + }; + + propagatedBuildInputs = [ + docutils + ]; + + # circular dependencies if enabled by default + doCheck = false; + checkInputs = [ + lxml + pytestCheckHook + wcag-contrast-ratio + ]; + + pythonImportsCheck = [ "pygments" ]; + + passthru.tests = { + check = pygments.overridePythonAttrs (_: { doCheck = true; }); + }; + + meta = with lib; { + homepage = "https://pygments.org/"; + description = "A generic syntax highlighter"; + license = licenses.bsd2; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; + }; +in pygments diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dbdaba232b4b..7326e68e62de 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7192,7 +7192,7 @@ in { pygments-better-html = callPackage ../development/python-modules/pygments-better-html { }; - pygments = callPackage ../development/python-modules/Pygments { }; + pygments = callPackage ../development/python-modules/pygments { }; pygments-markdown-lexer = callPackage ../development/python-modules/pygments-markdown-lexer { };