import: pypi: Use "pypi-uri" instead of building the URL manually.
authorCyril Roelandt <tipecaml@gmail.com>
Sun, 11 Oct 2015 23:03:25 +0000 (01:03 +0200)
committerCyril Roelandt <tipecaml@gmail.com>
Tue, 3 Nov 2015 20:38:13 +0000 (21:38 +0100)
* guix/import/pypi.scm (make-pypi-sexp): Use "pypi-uri".
* tests/pypi.scm: Update the tests accordingly.

guix/import/pypi.scm
tests/pypi.scm

index d04a685..647ef61 100644 (file)
@@ -165,7 +165,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
              (version ,version)
              (source (origin
                        (method url-fetch)
-                       (uri (string-append ,@(factorize-uri source-url version)))
+                       (uri (pypi-uri ,name version))
                        (sha256
                         (base32
                          ,(guix-hash-url temp)))))
index c772474..960b8cd 100644 (file)
@@ -84,8 +84,7 @@ baz > 13.37")
          ('version "1.0.0")
          ('source ('origin
                     ('method 'url-fetch)
-                    ('uri ('string-append "https://example.com/foo-"
-                                          'version ".tar.gz"))
+                    ('uri (pypi-uri "foo" version))
                     ('sha256
                      ('base32
                       (? string? hash)))))