diff options
| author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-07-11 14:21:01 +0100 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-09-25 09:36:19 +0100 |
| commit | 84e46a50011a13e704d6017dcb3d4c7fb358e4c7 (patch) | |
| tree | eca319e99bc113b3ca17f4190d7c3ee4cb0aacaf | |
| parent | 49a60ce1a7aa41ee137c517c02781ab0c641eee9 (diff) | |
gnu: borg: Switch to pyproject-build-system.
* gnu/packages/backup.scm (borg)
[build-system]: Use pyproject.
[arguments] <test-flags>: Move all test related options here; run
tests in parallel, supported by upstream.
<phases>: Use default 'check.
[native-inputs]: Add python-pytest-benchmark, python-pytest-xdist,
python-setuptools, and python-wheel.
Change-Id: Ifa47a71be055cab86ee3c0a8dc34b943da881ad7
| -rw-r--r-- | gnu/packages/backup.scm | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm index 80cf7a8bd21..1d3b66f150a 100644 --- a/gnu/packages/backup.scm +++ b/gnu/packages/backup.scm @@ -600,12 +600,37 @@ rsnapshot uses hard links to deduplicate identical files.") "src/borg/platform/posix.c" "src/borg/platform/syncfilerange.c" "src/borg/platform/windows.c")))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:modules '((srfi srfi-26) ; for cut (guix build utils) - (guix build python-build-system)) + (guix build pyproject-build-system)) + #:test-flags + #~(list "--benchmark-skip" + "--numprocesses" (number->string (parallel-job-count)) + "--pyargs" "borg.testsuite" + "-k" (string-join + ;; These tests need to write to '/var'. + (list "not test_get_cache_dir " + "test_get_config_dir " + "test_get_keys_dir " + "test_get_security_dir " + ;; These tests assume there is a root user in '/etc/passwd'. + "test_access_acl " + "test_default_acl " + "test_get_item_uid_gid " + "test_create_content_from_command " + "test_create_content_from_command_with_failed_command " + "test_create_stdin " + ;; These tests assume the kernel supports FUSE. + "test_fuse " + "test_fuse_allow_damaged_files " + "test_mount_hardlinks " + "test_readonly_mount " + "test_fuse_versions_view " + "test_migrate_lock_alive") + " and not ")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'set-env @@ -620,35 +645,6 @@ rsnapshot uses hard links to deduplicate identical files.") (setenv "BORG_LIBLZ4_PREFIX" lz4) (setenv "BORG_LIBXXHASH_PREFIX" xxhash) (setenv "BORG_LIBZSTD_PREFIX" zstd)))) - (replace 'check - (lambda* (#:key inputs outputs tests? #:allow-other-keys) - (when tests? - ;; The tests should be run in an empty directory. - (mkdir-p "tests") - (with-directory-excursion "tests" - (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k" - (string-append - ;; These tests need to write to '/var'. - "not test_get_cache_dir " - "and not test_get_config_dir " - "and not test_get_keys_dir " - "and not test_get_security_dir " - ;; These tests assume there is a root user in '/etc/passwd'. - "and not test_access_acl " - "and not test_default_acl " - "and not test_get_item_uid_gid " - "and not test_create_content_from_command " - "and not test_create_content_from_command_with_failed_command " - "and not test_create_stdin " - ;; We don't need to run benchmarks - "and not benchmark " - ;; These tests assume the kernel supports FUSE. - "and not test_fuse " - "and not test_fuse_allow_damaged_files " - "and not test_mount_hardlinks " - "and not test_readonly_mount " - "and not test_fuse_versions_view " - "and not test_migrate_lock_alive")))))) (add-after 'install 'install-doc (lambda _ (let ((man (string-append #$output "/share/man/man1")) @@ -672,7 +668,14 @@ rsnapshot uses hard links to deduplicate identical files.") (install-file "fish/borg.fish" (string-append share "/fish/vendor_completions.d"))))))))) (native-inputs - (list python-cython python-dateutil python-setuptools-scm python-pytest)) + (list python-cython + python-dateutil + python-pytest + python-pytest-benchmark + python-pytest-xdist + python-setuptools + python-setuptools-scm + python-wheel)) (inputs (list acl lz4 |
