From e73d77ae564169cf8428471c69a636d23f812c25 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 27 Mar 2021 22:42:26 +0000 Subject: [PATCH 1/2] python2Packages.pygments: enable tests advice over circular dependency appears outdated --- pkgs/development/python-modules/Pygments/2_5.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/Pygments/2_5.nix b/pkgs/development/python-modules/Pygments/2_5.nix index aa59c370d2e7..965e6f0ec343 100644 --- a/pkgs/development/python-modules/Pygments/2_5.nix +++ b/pkgs/development/python-modules/Pygments/2_5.nix @@ -3,6 +3,7 @@ , fetchPypi , fetchpatch , docutils +, pytestCheckHook }: buildPythonPackage rec { @@ -25,8 +26,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ docutils ]; - # Circular dependency with sphinx - doCheck = false; + checkInputs = [ pytestCheckHook ]; meta = { homepage = "https://pygments.org/"; From ac6e4a128799c5a54027de7b22978eb6d503da5d Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 27 Mar 2021 15:50:34 +0000 Subject: [PATCH 2/2] python3Packages.pygments: enable tests this requires a similar trick as used by hypothesis to get around pytest circular dependency --- pkgs/development/python-modules/Pygments/default.nix | 6 ++++-- pkgs/top-level/python-packages.nix | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/Pygments/default.nix b/pkgs/development/python-modules/Pygments/default.nix index a879aef02266..48d74fddd436 100644 --- a/pkgs/development/python-modules/Pygments/default.nix +++ b/pkgs/development/python-modules/Pygments/default.nix @@ -2,6 +2,8 @@ , buildPythonPackage , fetchPypi , docutils +, pytestCheckHook +, doCheck ? true }: buildPythonPackage rec { @@ -15,8 +17,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ docutils ]; - # Circular dependency with sphinx - doCheck = false; + inherit doCheck; + checkInputs = [ pytestCheckHook ]; meta = { homepage = "https://pygments.org/"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eda6869c4728..2650c0b565c6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6415,18 +6415,24 @@ in { pytest_5 = callPackage ../development/python-modules/pytest/5.nix { - # hypothesis tests require pytest that causes dependency cycle + # hypothesis & pygments tests require pytest that causes dependency cycle hypothesis = self.hypothesis.override { doCheck = false; }; + pygments = self.pygments.override { + doCheck = false; + }; }; pytest_6 = callPackage ../development/python-modules/pytest { - # hypothesis tests require pytest that causes dependency cycle + # hypothesis & pygments tests require pytest that causes dependency cycle hypothesis = self.hypothesis.override { doCheck = false; }; + pygments = self.pygments.override { + doCheck = false; + }; }; pytest_6_1 = self.pytest_6.overridePythonAttrs (oldAttrs: rec {