From b05ea761f67d0c40ec0791dbbddd7ef41b6ff9dd Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 19 May 2024 11:16:15 +0200 Subject: [PATCH] python312Packages.borb: refactor - enable tests --- .../python-modules/borb/default.nix | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/borb/default.nix b/pkgs/development/python-modules/borb/default.nix index bea6e9a3baf0..5d2d339fa4d1 100644 --- a/pkgs/development/python-modules/borb/default.nix +++ b/pkgs/development/python-modules/borb/default.nix @@ -1,13 +1,16 @@ { lib , buildPythonPackage , cryptography -, fetchPypi +, fetchFromGitHub , fonttools , lxml +, matplotlib +, pandas , pillow , python-barcode , pythonOlder , qrcode +, pytestCheckHook , requests , setuptools }: @@ -15,16 +18,22 @@ buildPythonPackage rec { pname = "borb"; version = "2.1.23"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.6"; - src = fetchPypi { - inherit pname version; - hash = "sha256-TJicWMqorCgfJmpujuM7jlq/BExwsXkOaO+/Ox2gR2A="; + src = fetchFromGitHub { + owner = "jorisschellekens"; + repo = "borb"; + rev = "refs/tags/v${version}"; + hash = "sha256-cpih7ijoT4dEdoFjh6qQcnzjWd2zusv4tNgPyrIghvg="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ cryptography fonttools lxml @@ -35,11 +44,27 @@ buildPythonPackage rec { setuptools ]; + nativeCheckInputs = [ + matplotlib + pandas + pytestCheckHook + ]; + pythonImportsCheck = [ "borb.pdf" ]; - doCheck = false; + disabledTests = [ + "test_code_files_are_small " + "test_image_has_pdfobject_methods" + ]; + + disabledTestPaths = [ + # Tests require network access + "tests/pdf/" + "tests/toolkit/" + "tests/license/" + ]; meta = with lib; { description = "Library for reading, creating and manipulating PDF files in Python";