[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/12] guix: Add a "pypi-uri" helper method.
From: |
Cyril Roelandt |
Subject: |
[PATCH 02/12] guix: Add a "pypi-uri" helper method. |
Date: |
Mon, 12 Oct 2015 23:40:58 +0200 |
* guix/download.scm (mirrors): New "pypi" mirror.
* guix/build-system/python.scm (pypi-uri): New method.
---
guix/build-system/python.scm | 10 +++++++++-
guix/download.scm | 4 +++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index e9fffcc..01525f4 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -31,7 +31,8 @@
#:export (%python-build-system-modules
package-with-python2
python-build
- python-build-system))
+ python-build-system
+ pypi-uri))
;; Commentary:
;;
@@ -40,6 +41,13 @@
;;
;; Code:
+(define (pypi-uri name version)
+ "Return a URI string for the Python package hosted on the Python Package
+Index (PyPI) corresponding to NAME and VERSION."
+ (string-append "mirror://pypi/packages/source/"
+ (string-take name 1) "/" name "/"
+ name "-" version ".tar.gz"))
+
(define %python-build-system-modules
;; Build-side modules imported by default.
`((guix build python-build-system)
diff --git a/guix/download.scm b/guix/download.scm
index 8ec47ce..53b28be 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -200,7 +200,9 @@
(debian
"http://ftp.de.debian.org/debian/"
"http://ftp.fr.debian.org/debian/"
- "http://ftp.debian.org/debian/"))))
+ "http://ftp.debian.org/debian/")
+ (pypi
+ "https://pypi.python.org/"))))
(define %mirror-file
;; Copy of the list of mirrors to a file. This allows us to keep a single
--
2.1.4
- [PATCH 00/12] Tons of patches to run "guix-tox" on python-keystoneclient!, Cyril Roelandt, 2015/10/12
- [PATCH 05/12] gnu: Add python-mccabe 0.2.1, Cyril Roelandt, 2015/10/12
- [PATCH 06/12] gnu: Add python-flake8-2.2.4, Cyril Roelandt, 2015/10/12
- [PATCH 07/12] gnu: Add python-hacking., Cyril Roelandt, 2015/10/12
- [PATCH 08/12] gnu: Add python-oslosphinx., Cyril Roelandt, 2015/10/12