diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2025-07-21 22:39:24 +0200 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-07-23 16:24:25 +0100 |
| commit | dffbfcfecaba79622ea610f1dd0f5a4d4951efbc (patch) | |
| tree | f1e8c61bd1ba3b3abbdca0d69c2696b72d8a6afe /gnu/packages/python-check.scm | |
| parent | 360da46b915b7c59e268417cf8e0e870b674ddf4 (diff) | |
gnu: python-cram: Improve style.
* gnu/packages/python-check.scm (python-cram): Run guix style, use
gexps.
Change-Id: I36946726869fd50a8386f699fd9b8becbdabe775
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/python-check.scm')
| -rw-r--r-- | gnu/packages/python-check.scm | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 8a78847e05e..998bb81edc0 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -454,52 +454,53 @@ nosetests, etc...) in Python projects.") (name "python-cram") (version "0.7") (home-page "https://bitheap.org/cram/") - (source (origin - (method url-fetch) - (uri (list (string-append home-page "cram-" - version ".tar.gz") - (pypi-uri "cram" version))) - (sha256 - (base32 - "0bvz6fwdi55rkrz3f50zsy35gvvwhlppki2yml5bj5ffy9d499vx")))) + (source + (origin + (method url-fetch) + (uri (list (string-append home-page "cram-" version ".tar.gz") + (pypi-uri "cram" version))) + (sha256 + (base32 "0bvz6fwdi55rkrz3f50zsy35gvvwhlppki2yml5bj5ffy9d499vx")))) + (build-system python-build-system) (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-source - (lambda _ - (substitute* (find-files "cram" ".*\\.py$") - ;; Replace default shell path. - (("/bin/sh") (which "sh"))) - (substitute* (find-files "tests" ".*\\.t$") - (("md5") "md5sum") - (("/bin/bash") (which "bash")) - (("/bin/sh") (which "sh"))) - (substitute* "cram/_test.py" - ;; This hack works around a bug triggered by substituting - ;; the /bin/sh paths. "tests/usage.t" compares the output of - ;; "cram -h", which breaks the output at 80 characters. This - ;; causes the line showing the default shell to break into two - ;; lines, but the test expects a single line... - (("env\\['COLUMNS'\\] = '80'") - "env['COLUMNS'] = '160'")) - - (substitute* "Makefile" - ;; Recent versions of python-coverage have caused the test - ;; coverage to decrease (as of version 0.7). Allow that. - (("--fail-under=100") - "--fail-under=90")) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* (find-files "cram" ".*\\.py$") + ;; Replace default shell path. + (("/bin/sh") + (which "sh"))) + (substitute* (find-files "tests" ".*\\.t$") + (("md5") + "md5sum") + (("/bin/bash") + (which "bash")) + (("/bin/sh") + (which "sh"))) + (substitute* "cram/_test.py" + ;; This hack works around a bug triggered by substituting + ;; the /bin/sh paths. "tests/usage.t" compares the output of + ;; "cram -h", which breaks the output at 80 characters. This + ;; causes the line showing the default shell to break into two + ;; lines, but the test expects a single line... + (("env\\['COLUMNS'\\] = '80'") + "env['COLUMNS'] = '160'")) - #t)) - (replace 'check - ;; The test phase uses the built library and executable. - (lambda* (#:key inputs outputs #:allow-other-keys) - (add-installed-pythonpath inputs outputs) - (setenv "PATH" (string-append (getenv "PATH") ":" - (assoc-ref outputs "out") "/bin")) - (invoke "make" "test")))))) - (build-system python-build-system) - (native-inputs - (list python-coverage python-setuptools python-wheel which)) + (substitute* "Makefile" + ;; Recent versions of python-coverage have caused the test + ;; coverage to decrease (as of version 0.7). Allow that. + (("--fail-under=100") + "--fail-under=90")))) + (replace 'check + ;; The test phase uses the built library and executable. + (lambda* (#:key inputs outputs #:allow-other-keys) + (add-installed-pythonpath inputs outputs) + (setenv "PATH" + (string-append (getenv "PATH") ":" #$output "/bin")) + (invoke "make" "test")))))) + (native-inputs (list python-coverage python-setuptools python-wheel which)) (synopsis "Simple testing framework for command line applications") (description "Cram is a functional testing framework for command line applications. |
