diff options
author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-05-01 09:33:52 +0100 |
---|---|---|
committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-05-01 12:29:19 +0100 |
commit | 4296310b59e8f04680c81ffa511adddfb9166897 (patch) | |
tree | c833490d4939754e9870444a8f8cf1dcd08e47b7 | |
parent | 3cecec63c5762efa037d2b7885366ac20990b97c (diff) | |
download | guix-4296310b59e8f04680c81ffa511adddfb9166897.tar.gz guix-4296310b59e8f04680c81ffa511adddfb9166897.zip |
gnu: python-cram: Move to python-check.
* gnu/packages/python-xyz.scm (python-cram): Move from here ...
* gnu/packages/python-check.scm: ... to here.
* gnu/packages/rcm.scm: Replace python-xyz with python-check module.
* gnu/packages/benchmark.scm: Add python-check module.
Change-Id: I0192701e4d4890735a18cc60abd2782fed8db090
-rw-r--r-- | gnu/packages/benchmark.scm | 1 | ||||
-rw-r--r-- | gnu/packages/python-check.scm | 61 | ||||
-rw-r--r-- | gnu/packages/python-xyz.scm | 59 | ||||
-rw-r--r-- | gnu/packages/rcm.scm | 2 |
4 files changed, 62 insertions, 61 deletions
diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index bc630bf723..a851d6b8e0 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -67,6 +67,7 @@ #:use-module (gnu packages polkit) #:use-module (gnu packages python) #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 518282921e..52ce51aa2e 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com> +;;; Copyright © 2016, 2018, 2019, 2020, 2022 Marius Bakke <marius@gnu.org> ;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com> -;;; Copyright © 2018, 2020, 2022 Marius Bakke <marius@gnu.org> ;;; Copyright © 2018-2020 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2019, 2021-2025 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il> @@ -445,6 +445,65 @@ This package provides seamless integration with coverage.py (and thus pytest, nosetests, etc...) in Python projects.") (license license:expat))) +(define-public python-cram + (package + (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")))) + (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")) + + #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)) + (synopsis "Simple testing framework for command line applications") + (description + "Cram is a functional testing framework for command line applications. +Cram tests look like snippets of interactive shell sessions. Cram runs each +command and compares the command output in the test with the command’s actual +output.") + (license license:gpl2+))) + (define-public python-crosshair (package (name "python-crosshair") diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index baeeed31d3..f3d23215ed 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -17047,65 +17047,6 @@ functionalities with some extras.") pseudo terminal (pty), and interact with both the process and its pty.") (license license:isc))) -(define-public python-cram - (package - (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")))) - (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")) - - #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)) - (synopsis "Simple testing framework for command line applications") - (description - "Cram is a functional testing framework for command line applications. -Cram tests look like snippets of interactive shell sessions. Cram runs each -command and compares the command output in the test with the command’s actual -output.") - (license license:gpl2+))) - (define-public python-crccheck (package (name "python-crccheck") diff --git a/gnu/packages/rcm.scm b/gnu/packages/rcm.scm index 6bdeeb7e9d..cca8583b4c 100644 --- a/gnu/packages/rcm.scm +++ b/gnu/packages/rcm.scm @@ -22,7 +22,7 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix licenses) - #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-check) #:use-module (gnu packages perl)) (define-public rcm |