import: pypi: Preserve order of dependencies from ‘requires.txt’ and wheel.

Fixes a regression introduced in
a3ffb920f1 and revealed by
‘tests/pypi.scm’.

* guix/import/pypi.scm (parse-requires.txt): Reverse REQUIRED-DEPS and
TEST-DEPS when returning.
(parse-wheel-metadata): Likewise.

Change-Id: I2c374505052f0d9e46e7cc1c11d3e97ab522e068
This commit is contained in:
Ludovic Courtès 2024-12-30 10:40:37 +01:00
parent 13e7caf52c
commit 4ebc1aba19
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -283,7 +283,8 @@ (define (section-header? line)
(let ((line (read-line port)))
(cond
((eof-object? line)
(list required-deps test-deps))
(list (reverse required-deps)
(reverse test-deps)))
((or (string-null? line) (comment? line))
(loop required-deps test-deps inside-test-section? optional?))
((section-header? line)
@ -337,7 +338,8 @@ (define (test-requirement? line)
(let ((line (read-line port)))
(cond
((eof-object? line)
(list required-deps test-deps))
(list (reverse required-deps)
(reverse test-deps)))
((and (requires-dist-header? line) (not (extra? line)))
(loop (cons (specification->requirement-name
(requires-dist-value line))