import: pypi: Deduplicate requirements.

* guix/import/pypi.scm (parse-requires.txt): Remove potential duplicates.
This commit is contained in:
Maxim Cournoyer 2019-03-28 00:26:01 -04:00
parent 803fb336d6
commit cc9a77cd39
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 5 additions and 1 deletions

View File

@ -177,7 +177,11 @@ requirement names."
;; (extra) requirements. Non-optional requirements must appear ;; (extra) requirements. Non-optional requirements must appear
;; before any section is defined. ;; before any section is defined.
(if (or (eof-object? line) (section-header? line)) (if (or (eof-object? line) (section-header? line))
(reverse result) ;; 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"
(reverse (delete-duplicates result))
(cond (cond
((or (string-null? line) (comment? line)) ((or (string-null? line) (comment? line))
(loop result)) (loop result))