From 65564f03966f09c0f05d47d586474a83b1082916 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Wed, 18 Sep 2024 17:59:01 -0400 Subject: [PATCH] python3Packages.pymupdf: clean up checks and testing exceptions --- .../python-modules/pymupdf/default.nix | 111 ++++-------------- 1 file changed, 25 insertions(+), 86 deletions(-) diff --git a/pkgs/development/python-modules/pymupdf/default.nix b/pkgs/development/python-modules/pymupdf/default.nix index 87178c461693..21b4a6f2b869 100644 --- a/pkgs/development/python-modules/pymupdf/default.nix +++ b/pkgs/development/python-modules/pymupdf/default.nix @@ -25,8 +25,10 @@ mupdf, # tests - fonttools, pytestCheckHook, + fonttools, + pillow, + pymupdf-fonts, }: let @@ -96,97 +98,34 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook + ]; + + checkInputs = [ fonttools + pillow + pymupdf-fonts + ]; + + disabledTests = [ + # Do not lint code + "test_codespell" + "test_pylint" + "test_flake8" + # Upstream recommends disabling these when not using bundled MuPDF build + "test_color_count" + "test_3050" + "test_textbox3" + ]; + + pythonImportsCheck = [ + "pymupdf" + "fitz" ]; preCheck = '' - export PATH="$PATH:$out/bin"; + export PATH="$out/bin:$PATH"; ''; - disabledTests = - [ - # Fails in release tarballs without .git - "test_codespell" - "test_pylint" - # fails for indeterminate reasons - "test_2548" - "test_2753" - "test_3020" - "test_3050" - "test_3058" - "test_3177" - "test_3186" - "test_color_count" - "test_pilsave" - "test_fz_write_pixmap_as_jpeg" - # NotImplementedError - "test_1824" - "test_2093" - "test_2093" - "test_2108" - "test_2182" - "test_2182" - "test_2246" - "test_2270" - "test_2270" - "test_2391" - "test_2788" - "test_2861" - "test_2871" - "test_2886" - "test_2904" - "test_2922" - "test_2934" - "test_2957" - "test_2969" - "test_3070" - "test_3131" - "test_3140" - "test_3209" - "test_3209" - "test_3301" - "test_3347" - "test_caret" - "test_deletion" - "test_file_info" - "test_line" - "test_page_links_generator" - "test_polyline" - "test_redact" - "test_techwriter_append" - "test_text2" - # Issue with FzArchive - "test_htmlbox" - "test_2246" - "test_3140" - "test_3400" - "test_707560" - "test_open" - "test_objectstream1" - "test_objectstream2" - "test_objectstream3" - "test_fit_springer" - "test_write_stabilized_with_links" - "test_textbox" - "test_delete_image" - # Fonts not available - "test_fontarchive" - "test_subset_fonts" - # Exclude lint tests - "test_flake8" - ] - ++ lib.optionals stdenv.isDarwin [ - # darwin does not support OCR right now - "test_tesseract" - ]; - - disabledTestPaths = [ - # Issue with FzArchive - "tests/test_docs_samples.py" - ]; - - pythonImportsCheck = [ "fitz" ]; - meta = { description = "Python bindings for MuPDF's rendering library"; homepage = "https://github.com/pymupdf/PyMuPDF";