~ruther/guix-local

748f6266a32f6ce32670280958fed050c36b6208 — Sharlatan Hellseher 5 months ago 0c26b52
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
1 files changed, 32 insertions(+), 23 deletions(-)

M gnu/packages/check.scm
M gnu/packages/check.scm => gnu/packages/check.scm +32 -23
@@ 2166,38 2166,47 @@ see the output as well as any file modifications.")

(define-public python-testtools
  (package
    (inherit python-testtools-bootstrap)
    (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
     (list
      #:test-backend #~'custom
      #:test-flags #~(list "-m" "testtools.run" "testtools.tests.test_suite")
      #:phases
      '(modify-phases %standard-phases
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               ;; There are six failing tests:
               ;; "test_fast_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_second_time"
               ;; "test_sigint_raises_no_result_error"
               ;; "test_sigint_raises_no_result_error_second_time"
               (substitute* "testtools/tests/twistedsupport/__init__.py"
                 (("test_spinner,") "")
                 (("test_runtest,") ""))
               (invoke "python" "-m" "testtools.run"
                       "testtools.tests.test_suite")))))))
    (propagated-inputs
     (list python-fixtures python-pbr))
      #~(modify-phases %standard-phases
          (add-before 'check 'pre-check
            (lambda _
              ;; There are six failing tests:
              ;; "test_fast_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_second_time"
              ;; "test_sigint_raises_no_result_error"
              ;; "test_sigint_raises_no_result_error_second_time"
              (substitute* "testtools/tests/twistedsupport/__init__.py"
                (("test_spinner,") "")
                (("test_runtest,") "")))))))
    (native-inputs
     (list python-hatchling python-hatch-vcs
           python-testscenarios-bootstrap
     (list python-hatch-vcs
           python-hatchling
           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
     "Testtools extends the Python standard library unit testing framework to
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
;; nothing depends on it.