summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2019-03-28 00:26:01 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2019-07-02 10:07:59 +0900
commitcc9a77cd396f8932bec1b8c7ae9d829ea76f37ec (patch)
tree2d54cb085f66a7101f617d412acb37e1558011d2 /guix
parent803fb336d62ea65990e263ce58d8552e04c9c038 (diff)
import: pypi: Deduplicate requirements.
* guix/import/pypi.scm (parse-requires.txt): Remove potential duplicates.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/pypi.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 6a881bda12..ad59a8b731 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -177,7 +177,11 @@ requirement names."
;; (extra) requirements. Non-optional requirements must appear
;; before any section is defined.
(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
((or (string-null? line) (comment? line))
(loop result))