From b6fcddc4134d8a6acb3df3725f39f62fdc2fd74c Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sat, 11 Oct 2025 19:57:19 +0200 Subject: [PATCH] gnu: Add python-approvaltests. * gnu/packages/python-check.scm (python-approvaltests): New variable. Change-Id: I6a8d5138c059936f1535bd0dce09b1cc9fac8f06 Signed-off-by: Sharlatan Hellseher --- gnu/packages/python-check.scm | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index e15ab8e2e2743b35d1ed585cb1d7c9e1bc099d34..d215d8788e8fe416d4ae7696583f1e8074c15484 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -80,6 +80,7 @@ #:use-module (gnu packages version-control) #:use-module (gnu packages web) #:use-module (gnu packages xml) + #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system pyproject) @@ -191,6 +192,50 @@ most situations.") @code{python-approvaltests}.") (license license:asl2.0))) +(define-public python-approvaltests + (package/inherit python-approval-utilities + (name "python-approvaltests") + (version (package-version python-approval-utilities)) + (arguments + (list + #:tests? #f ; Tests are run in the python-approvaltests package. + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (substitute* "setup/setup_utils.py" + (("version=get_version\\(\\),") + (format #f "version=~s," #$version)) + (("\\(get_parent_directory\\(\\)\\.parent / ") + "Path(")) + (rename-file "setup/setup.py" + "setup.py") + ;; Assume the chdir. + (substitute* "setup.py" + (("\\.\\.") + ".")) + (rename-file "setup/setup_utils.py" + "setup_utils.py")))))) + (native-inputs (list python-setuptools)) + (propagated-inputs + (list python-allpairspy + python-approval-utilities + python-beautifulsoup4 + python-empty-files + python-mock + python-pyperclip + python-pytest + python-testfixtures + python-typing-extensions)) + (home-page "https://github.com/approvals/ApprovalTests.Python") + (synopsis "Assertion/verification library to aid testing") + (description + "This package provides tools verify objects that require more than a +simple assert including long strings, large arrays, and complex hash +structures and objects, i.e. when you need a more granular look at the test +failure.") + (license license:asl2.0))) + (define-public python-assay ;; No release yet. (let ((commit "74617d70e77afa09f58b3169cf496679ac5d5621")