From 8570864ba0b9585a4b36e7e5d091450e72208bd9 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 12 Dec 2022 22:25:23 +0000 Subject: [PATCH] python3Packages.jpylyzer: skip test_testfiles by default still available as a passthru test though Fixes #205780 --- .../python-modules/jpylyzer/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/jpylyzer/default.nix b/pkgs/development/python-modules/jpylyzer/default.nix index e161b3ffc502..48388d9b0d80 100644 --- a/pkgs/development/python-modules/jpylyzer/default.nix +++ b/pkgs/development/python-modules/jpylyzer/default.nix @@ -5,6 +5,10 @@ , six , lxml , pytestCheckHook +, doFullCheck ? false # weird filenames cause issues on some filesystems + +# for passthru.tests +, jpylyzer }: let @@ -33,12 +37,12 @@ in buildPythonPackage rec { checkInputs = [ pytestCheckHook lxml ]; - # don't depend on testFiles on darwin as it may not be extractable due to - # weird filenames - preCheck = lib.optionalString (!stdenv.isDarwin) '' + # don't depend on testFiles unless doFullCheck as it may not be extractable + # on some filesystems due to weird filenames + preCheck = lib.optionalString doFullCheck '' sed -i '/^testFilesDir = /ctestFilesDir = "${testFiles}"' tests/unit/test_testfiles.py ''; - disabledTestPaths = lib.optionals stdenv.isDarwin [ + disabledTestPaths = lib.optionals (!doFullCheck) [ "tests/unit/test_testfiles.py" ]; @@ -46,6 +50,10 @@ in buildPythonPackage rec { disallowedReferences = [ testFiles ]; + passthru.tests = { + withFullCheck = jpylyzer.override { doFullCheck = true; }; + }; + meta = with lib; { description = "JP2 (JPEG 2000 Part 1) image validator and properties extractor"; homepage = "https://jpylyzer.openpreservation.org/";