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 @@ (define (requirements->upstream-inputs deps type)
(type type))))
(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>.
(let ((dependencies (guess-requirements source-url wheel-url archive)))
(match dependencies
((propagated native)
(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)
"Return the list of <upstream-input> for PYPI-PACKAGE. This procedure