diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 878a1f755e0..5bcdb6bf1e5 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -10968,7 +10968,21 @@ include_dirs = ~:*~a/include~%" #$(this-package-input "openblas")))))) (lambda* (#:key tests? test-flags #:allow-other-keys) (when tests? (with-directory-excursion #$output - (apply invoke "pytest" test-flags)))))))) + (apply invoke "pytest" test-flags))))) + ;; The executables provided by this package ('f2py' and 'numpy-config') + ;; only depend on Python. By customizing the wrap phase we can ensure + ;; that we don't add all Python packages listed in native-inputs to + ;; the closure. This significantly reduces the overall closure size. + ;; + ;; See also . + (replace 'wrap + (lambda* (#:key inputs outputs #:allow-other-keys) + (for-each + (lambda (program) + (wrap-program program + `("GUIX_PYTHONPATH" ":" suffix + ,(list (site-packages inputs outputs))))) + (find-files (in-vicinity #$output "/bin")))))))) (native-inputs (list gfortran meson-python