unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: swedebugia@riseup.net
To: guix-devel@gnu.org
Cc: guix-devel-bounces+swedebugia=riseup.net@gnu.org
Subject: Re: [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri.
Date: Sun, 03 Jan 2016 22:53:47 +0100	[thread overview]
Message-ID: <799c3ce9640d27cd7e6e471801e06f04@riseup.net> (raw)
In-Reply-To: <1451856997-13507-1-git-send-email-swedebugia@riseup.net>

On 2016-01-03 22:36, swedebugia wrote:
> ---
>  guix/build-system/python.scm | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/guix/build-system/python.scm 
> b/guix/build-system/python.scm
> index 2532210..09074ce 100644
> --- a/guix/build-system/python.scm
> +++ b/guix/build-system/python.scm
> @@ -41,13 +41,20 @@
>  ;;
>  ;; Code:
> 
> -(define (pypi-uri name version)
> +(define* (pypi-uri name version
> +                  #:optional
> +                  ending)
>    "Return a URI string for the Python package hosted on the Python 
> Package
> -Index (PyPI) corresponding to NAME and VERSION."
> -  (string-append "https://pypi.python.org/packages/source/"
> +Index (PyPI) corresponding to NAME, VERSION and optionally ENDING."
> +  (when (null? ending)
> +      (string-append "https://pypi.python.org/packages/source/"
>                   (string-take name 1) "/" name "/"
> -                 name "-" version ".tar.gz"))
> -
> +                 name "-" version ".tar.gz")
> +  ;; Ending is set -> use it.
> +      (string-append "https://pypi.python.org/packages/source/"
> +                 (string-take name 1) "/" name "/"
> +                 name "-" version "." ending)))
> +
>  (define %python-build-system-modules
>    ;; Build-side modules imported by default.
>    `((guix build python-build-system)

Was this an acceptable output of git send-email?
I have yet to test this patch, but it compiled fine.

Those interested can test the code with this unfinished package-def:

(define-public python-twisted
(package
   (name "python-twisted")
   (version "15.5.0")
   (source
     (origin
       (method url-fetch)
       (ending "tar.bz2")
       (uri (pypi-uri "Twisted" version ending))
       (sha256
         (base32
          "0zy18lcrris4aaslil5k12i13k56c32hzfdv6h10kbnzl026h158")
         ))
   (build-system python-build-system)
   (inputs
     `(("python-setuptools" ,python-setuptools)))
   (home-page "http://twistedmatrix.com/")
   (synopsis
     "Asynchronous networking framework written in Python")
   (description
     "Asynchronous networking framework written in Python which 
implements a
wide range of popular network protocols.")
   (license license:expat))))

  reply	other threads:[~2016-01-03 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 21:36 [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri swedebugia
2016-01-03 21:53 ` swedebugia [this message]
2016-01-05  0:53 ` Cyril Roelandt
2016-01-05  9:58   ` Efraim Flashner
2016-01-05 10:23     ` Cyril Roelandt
2016-01-08 18:14 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=799c3ce9640d27cd7e6e471801e06f04@riseup.net \
    --to=swedebugia@riseup.net \
    --cc=guix-devel-bounces+swedebugia=riseup.net@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).