diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2024-12-15 17:02:44 +0100 |
---|---|---|
committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-12-16 19:28:44 +0000 |
commit | a3ffb920f14cd0d31d1e7067e11dc523fe380996 (patch) | |
tree | 2efa1d844610f4c11bfaf09c0d0dd80655101e59 | |
parent | c904350a81f9ff47cc025bc9d0d48f1bd2ead30e (diff) | |
download | guix-a3ffb920f14cd0d31d1e7067e11dc523fe380996.tar.gz guix-a3ffb920f14cd0d31d1e7067e11dc523fe380996.zip |
import: pypi: Move deduplication to final processing step.
* guix/import/pypi.scm (parse-requires.txt): Remove deduplication.
(parse-wheel-metadata): Remove deduplication.
(compute-inputs): Instead do it here on all the collected inputs.
Change-Id: I2504cc693e9bf2e4cc44fd37b5823904dbaaa925
Reviewed-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
-rw-r--r-- | guix/import/pypi.scm | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index d0dda607a1..935ecd33d0 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -283,12 +283,7 @@ satisfy." (let ((line (read-line port))) (cond ((eof-object? line) - ;; Duplicates can occur, since the same requirement can be - ;; listed multiple times with different conditional markers, e.g. - ;; pytest >= 3 ; python_version >= "3.3" - ;; pytest < 3 ; python_version < "3.3" - (map (compose reverse delete-duplicates) - (list required-deps test-deps))) + (list required-deps test-deps)) ((or (string-null? line) (comment? line)) (loop required-deps test-deps inside-test-section? optional?)) ((section-header? line) @@ -342,8 +337,7 @@ returned value." (let ((line (read-line port))) (cond ((eof-object? line) - (map (compose reverse delete-duplicates) - (list required-deps test-deps))) + (list required-deps test-deps)) ((and (requires-dist-header? line) (not (extra? line))) (loop (cons (specification->requirement-name (requires-dist-value line)) @@ -486,8 +480,10 @@ the corresponding list of <upstream-input> records." (let ((dependencies (guess-requirements source-url wheel-url archive))) (match dependencies ((propagated native) - (append (requirements->upstream-inputs propagated 'propagated) - (requirements->upstream-inputs (add-missing-native-inputs native) 'native)))))) + (append (requirements->upstream-inputs (delete-duplicates propagated) + 'propagated) + (requirements->upstream-inputs (delete-duplicates (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 |