From 31768a3f461f744fc6a27122fb8aa3c5e8deed91 Mon Sep 17 00:00:00 2001 From: jgart Date: Thu, 25 Dec 2025 17:39:41 -0500 Subject: [PATCH] gnu: borgmatic: Enable all tests. * gnu/packages/backup.scm (borgmatic): Enable all tests. [source]: Use GitHub source. [arguments]: Enable all tests and format code. Change-Id: Ia05ed054f13fb234fae8571d1c17aa1f99081747 --- gnu/packages/backup.scm | 55 ++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm index 019a1d7fc363ba978edaee06e968ea1a1ea8e8b5..257992aa378b96dd8735a837b4f559a29df72c78 100644 --- a/gnu/packages/backup.scm +++ b/gnu/packages/backup.scm @@ -1212,36 +1212,39 @@ compression parameters used by Gzip.") (version "2.0.13") (source (origin - (method url-fetch) - (uri (pypi-uri "borgmatic" version)) + ;; PyPI archive does not contain NEWS file needed for one test. + (method git-fetch) + (uri (git-reference + (url "https://github.com/borgmatic-collective/borgmatic") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "1dffzbrfbclr1pbzl8d3vvfz7l2v1p3namr3vjl71rnb3y1f7ynh")))) + (base32 + "05w3j4knhsg4w0a0yrz8c7lvz3vp3nf95ddmql9i8mqknjqddm1v")))) (build-system pyproject-build-system) (arguments (list - #:test-flags - ;; TODO: Disable failing test. - #~(list "-k" "not test_borgmatic_version_matches_news_version") - #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'configure - (lambda* (#:key inputs #:allow-other-keys) - ;; Set absolute store path to borg. - (substitute* "borgmatic/commands/borgmatic.py" - (("\\.get\\('local_path', 'borg'\\)") - (string-append ".get('local_path', '" - (search-input-file inputs "bin/borg") - "')"))) - (substitute* "tests/unit/commands/test_borgmatic.py" - (("(module.get_local_path.+ == )'borg'" all start) - (string-append start "'" - (search-input-file inputs "bin/borg") - "'"))))) - (add-before 'check 'set-path - (lambda _ - ;; Tests require the installed executable. - (setenv "PATH" - (string-append #$output "/bin" ":" - (getenv "PATH")))))))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'configure + (lambda* (#:key inputs #:allow-other-keys) + ;; Set absolute store path to borg. + (substitute* "borgmatic/commands/borgmatic.py" + (("\\.get\\('local_path', 'borg'\\)") + (string-append ".get('local_path', '" + (search-input-file inputs "bin/borg") + "')"))) + (substitute* "tests/unit/commands/test_borgmatic.py" + (("(module.get_local_path.+ == )'borg'" all start) + (string-append start "'" + (search-input-file inputs "bin/borg") + "'"))))) + (add-before 'check 'set-path + (lambda _ + ;; Tests require the installed executable. + (setenv "PATH" + (string-append #$output "/bin" ":" + (getenv "PATH")))))))) (native-inputs (list python-flexmock python-pytest