1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-10 16:50:43 +02:00

import: pypi: Add python-wheel to native inputs if setuptools is used.

* guix/import/pypi.scm (compute-inputs): Add missing python-wheel if
necessary.

Change-Id: Iedad213a6684856e48349289c4d9beba953f396b
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Lars-Dominik Braun 2024-12-15 13:30:59 +01:00 committed by Sharlatan Hellseher
parent 8bb3bb19c2
commit d7890af335
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -470,12 +470,18 @@ the corresponding list of <upstream-input> records."
(type type)))) (type type))))
(sort deps string-ci<?))) (sort deps string-ci<?)))
(define (add-missing-native-inputs inputs)
;; setuptools cannot build wheels without the python-wheel.
(if (member "setuptools" inputs)
(cons "wheel" inputs)
inputs))
;; TODO: Record version number ranges in <upstream-input>. ;; TODO: Record version number ranges in <upstream-input>.
(let ((dependencies (guess-requirements source-url wheel-url archive))) (let ((dependencies (guess-requirements source-url wheel-url archive)))
(match dependencies (match dependencies
((propagated native) ((propagated native)
(append (requirements->upstream-inputs propagated 'propagated) (append (requirements->upstream-inputs propagated 'propagated)
(requirements->upstream-inputs native 'native)))))) (requirements->upstream-inputs (add-missing-native-inputs native) 'native))))))
(define* (pypi-package-inputs pypi-package #:optional version) (define* (pypi-package-inputs pypi-package #:optional version)
"Return the list of <upstream-input> for PYPI-PACKAGE. This procedure "Return the list of <upstream-input> for PYPI-PACKAGE. This procedure