gnu: python-testtools: Switch to pyproject.

* gnu/packages/check.scm (python-testtools): Don't inherit from
python-testtools-bootstrap as it's no longer required and migrate
missing fields from it.
[build-system]: Switch to pyproject-build-system.
[arguments] <test-backend>: Use custom.
<test-flags>: Provide options to run testtols.
<phases>: Use default 'check; add 'pre-check.
[propagated-inputs]: Remove python-pbr.
[native-inputs]: Remove python-setuptools.
[licenses]: Fix it according to pyproject.toml and PyPI.

Change-Id: I7c9f5618d90b882141f1880ef7c29996d6a0364b
This commit is contained in:
Sharlatan Hellseher 2025-09-19 14:11:19 +01:00
parent 7ada6962a5
commit 3dae45f8cc
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -2166,38 +2166,47 @@ see the output as well as any file modifications.")
(define-public python-testtools (define-public python-testtools
(package (package
(inherit python-testtools-bootstrap)
(name "python-testtools") (name "python-testtools")
(version "2.7.2")
(source
(origin
(method url-fetch)
(uri (pypi-uri "testtools" version))
(sha256
(base32 "18vy77n4ab2dvgx5ni6gfp2d0haxhh3yrkm6mih8n3zsy30vprav"))))
(build-system pyproject-build-system)
(arguments (arguments
(list (list
#:test-backend #~'custom
#:test-flags #~(list "-m" "testtools.run" "testtools.tests.test_suite")
#:phases #:phases
'(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'check (add-before 'check 'pre-check
(lambda* (#:key tests? #:allow-other-keys) (lambda _
(when tests? ;; There are six failing tests:
;; There are six failing tests: ;; "test_fast_keyboard_interrupt_stops_test_run"
;; "test_fast_keyboard_interrupt_stops_test_run" ;; "test_keyboard_interrupt_stops_test_run"
;; "test_keyboard_interrupt_stops_test_run" ;; "test_fast_sigint_raises_no_result_error"
;; "test_fast_sigint_raises_no_result_error" ;; "test_fast_sigint_raises_no_result_error_second_time"
;; "test_fast_sigint_raises_no_result_error_second_time" ;; "test_sigint_raises_no_result_error"
;; "test_sigint_raises_no_result_error" ;; "test_sigint_raises_no_result_error_second_time"
;; "test_sigint_raises_no_result_error_second_time" (substitute* "testtools/tests/twistedsupport/__init__.py"
(substitute* "testtools/tests/twistedsupport/__init__.py" (("test_spinner,") "")
(("test_spinner,") "") (("test_runtest,") "")))))))
(("test_runtest,") ""))
(invoke "python" "-m" "testtools.run"
"testtools.tests.test_suite")))))))
(propagated-inputs
(list python-fixtures python-pbr))
(native-inputs (native-inputs
(list python-hatchling python-hatch-vcs (list python-hatch-vcs
python-testscenarios-bootstrap python-hatchling
python-twisted python-twisted
python-setuptools)) ;due to python-pbr python-testscenarios-bootstrap))
(propagated-inputs
(list python-fixtures))
(home-page "https://github.com/testing-cabal/testtools")
(synopsis "Extensions to the Python standard library unit testing framework")
(description (description
"Testtools extends the Python standard library unit testing framework to "Testtools extends the Python standard library unit testing framework to
provide matchers, more debugging information, and cross-Python provide matchers, more debugging information, and cross-Python
compatibility."))) compatibility.")
(license license:expat)))
;; XXX: The project is not maintained since 2015, consider to remove when ;; XXX: The project is not maintained since 2015, consider to remove when
;; nothing depends on it. ;; nothing depends on it.