mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-scikit-image: Fix tests.
In some cases there could be an issue to test compiled Cython library which is not available in local checkout working directory. This change is inspired by the way NixOS packages scikit-image and run tests from the output with "--pyargs" option where compiled library is available. See: <https://github.com/NixOS/nixpkgs/blob/nixos-25.05/\ pkgs/development/python-modules/scikit-image/default.nix>. * gnu/packages/python-science.scm (python-scikit-image) [arguments] <test-flags>: Run tests from {#$output}, add "--pyargs" option and skip one more problematic test. <phases>: Use default 'check; add 'pre-check and post-check. Change-Id: I60f58359f59b371854f4963e2f7c65c9221a0924
This commit is contained in:
parent
d7c5315913
commit
0fb7ae747f
1 changed files with 23 additions and 10 deletions
|
@ -2256,28 +2256,41 @@ logic, also known as grey logic.")
|
|||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/scikit-image/scikit-image")
|
||||
(commit (string-append "v" version))))
|
||||
(url "https://github.com/scikit-image/scikit-image")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "1bc8i57sjk44vd9k1ilr6fpvfq1zbq9yfi22lz22k26mzrlisym3"))))
|
||||
(build-system pyproject-build-system)
|
||||
(arguments
|
||||
(list
|
||||
;; Disable flaky test
|
||||
#:test-flags #~(list "-k" "not test_ellipse_parameter_stability")
|
||||
#:test-flags
|
||||
;; To make sure we test compiled and installed module.
|
||||
#~(list (string-append #$output "/lib/python"
|
||||
#$(version-major+minor (package-version python))
|
||||
"/site-packages")
|
||||
"--pyargs" "skimage"
|
||||
;; Disable flaky test
|
||||
"-k" (string-join
|
||||
(list "not test_ellipse_parameter_stability"
|
||||
;; ValueError: Cannot call len() on object with unknown chunk size.
|
||||
"test_thresholds_dask_compatibility[threshold_triangle-41-43]")
|
||||
" and not "))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-before 'build 'change-home-dir
|
||||
(lambda _
|
||||
;; Change from /homeless-shelter to /tmp for write permission.
|
||||
(setenv "HOME" "/tmp")))
|
||||
(replace 'check
|
||||
(lambda* (#:key tests? test-flags #:allow-other-keys)
|
||||
(when tests?
|
||||
(with-directory-excursion "/tmp"
|
||||
(apply invoke "pytest" "-v" "--doctest-modules"
|
||||
(append test-flags (list #$output))))))))))
|
||||
(add-before 'check 'pre-check
|
||||
(lambda _
|
||||
;; To prevent loading tests twise.
|
||||
;; 16277 passed, 240 skipped, 4 deselected
|
||||
(delete-file-recursively "skimage")))
|
||||
(add-before 'check 'post-check
|
||||
(lambda _
|
||||
(for-each delete-file-recursively
|
||||
(find-files #$output "__pycache__" #:directories? #t)))))))
|
||||
;; See requirements/ for the list of build and run time requirements.
|
||||
;; NOTE: scikit-image has an optional dependency on python-pooch, however
|
||||
;; propagating it would enable many more tests that require online data.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue