unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add python2-qrcode
@ 2016-06-14 19:26 Daniel Pimentel
  2016-06-14 19:51 ` ng0
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-14 19:26 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 53 bytes --]

Added python2-qrcode.

-- 
Daniel Pimentel (aka d4n1)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-Add-python2-qrcode.patch --]
[-- Type: text/x-diff; name=0003-gnu-Add-python2-qrcode.patch, Size: 1668 bytes --]

From 3a9c7b2ed591a32ff7d8b40f1b24ee51f8350577 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Tue, 14 Jun 2016 16:23:41 -0300
Subject: [PATCH 3/3] gnu: Add python2-qrcode

---
 gnu/packages/python.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index c9ac1f1..efdce9a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9058,3 +9058,29 @@ new (proposed) 2.0 spec, which includes batch submission, keyword arguments,
      "This module implements the password-based key derivation function, 
 PBKDF2, specified in RSA PKCS#5 v2.0.")
     (license license:expat)))
+
+(define-public python2-qrcode
+  (package
+    (name "python2-qrcode")
+    (version "5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://pypi.python.org/packages/source/q/qrcode/qrcode-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0skzrvhjnnacrz52jml4i050vdx5lfcd3np172srxjaghdgfxg9k"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-setuptools" ,python2-setuptools)
+       ("python2-pillow" ,python2-pillow)
+       ("python2-six" ,python2-six)))    
+    (arguments
+     `(#:python ,python-2)) ; only Python 2.7 is supported
+    (home-page "https://pypi.python.org/pypi/qrcode")
+    (synopsis "Python library to generate QR Codes")
+    (description
+     "Python library that uses image libraries, Python Imaging Library (PIL) 
+by default, to generate QR Codes.")
+    (license license:expat)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Add python2-qrcode
  2016-06-14 19:26 [PATCH] gnu: Add python2-qrcode Daniel Pimentel
@ 2016-06-14 19:51 ` ng0
  2016-06-14 20:00   ` [PATCH] gnu: Update python2-qrcode Daniel Pimentel
  0 siblings, 1 reply; 14+ messages in thread
From: ng0 @ 2016-06-14 19:51 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]

On 2016-06-14(04:26:08PM-0300), Daniel Pimentel wrote:
> Added python2-qrcode.
>
> --
> Daniel Pimentel (aka d4n1)

> From 3a9c7b2ed591a32ff7d8b40f1b24ee51f8350577 Mon Sep 17 00:00:00 2001
> From: Daniel Pimentel <d4n1@d4n1.org>
> Date: Tue, 14 Jun 2016 16:23:41 -0300
> Subject: [PATCH 3/3] gnu: Add python2-qrcode
>
> ---
>  gnu/packages/python.scm | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index c9ac1f1..efdce9a 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -9058,3 +9058,29 @@ new (proposed) 2.0 spec, which includes batch submission, keyword arguments,
>       "This module implements the password-based key derivation function,
>  PBKDF2, specified in RSA PKCS#5 v2.0.")
>      (license license:expat)))
> +
> +(define-public python2-qrcode
> +  (package
> +    (name "python2-qrcode")
> +    (version "5.1")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "http://pypi.python.org/packages/source/q/qrcode/qrcode-"

Could you use https://pypi.python.org/packages/source/q/qrcode/qrcode-"
instead of the http uri?

> +                    version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "0skzrvhjnnacrz52jml4i050vdx5lfcd3np172srxjaghdgfxg9k"))))
> +    (build-system python-build-system)
> +    (inputs
> +     `(("python2-setuptools" ,python2-setuptools)
> +       ("python2-pillow" ,python2-pillow)
> +       ("python2-six" ,python2-six)))
> +    (arguments
> +     `(#:python ,python-2)) ; only Python 2.7 is supported
> +    (home-page "https://pypi.python.org/pypi/qrcode")
> +    (synopsis "Python library to generate QR Codes")
> +    (description
> +     "Python library that uses image libraries, Python Imaging Library (PIL)
> +by default, to generate QR Codes.")
> +    (license license:expat)))
> --
> 2.7.4
>

Otherwise it looks good to me. I can't run it because I'm running and testing
something myself.

thanks,
--
♥Ⓐ ng0
For non-prism friendly talk find me on
psyced.org / loupsycedyglgamf.onion

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Update python2-qrcode
  2016-06-14 19:51 ` ng0
@ 2016-06-14 20:00   ` Daniel Pimentel
  2016-06-14 21:12     ` ng0
  2016-06-16 12:14     ` [PATCH] gnu: Update python2-qrcode (refactored) Daniel Pimentel
  0 siblings, 2 replies; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-14 20:00 UTC (permalink / raw)
  To: guix-devel; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

> Could you use https://pypi.python.org/packages/source/q/qrcode/qrcode-"
> instead of the http uri?

Done!

Thanks :)

-- 
Daniel Pimentel (aka d4n1)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0007-gnu-Update-python2-qrcode.patch --]
[-- Type: text/x-diff; name=0007-gnu-Update-python2-qrcode.patch, Size: 843 bytes --]

From 55137a720f4642fff0b67d91e37887e1ae14b8c5 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Tue, 14 Jun 2016 16:58:31 -0300
Subject: [PATCH 7/7] gnu: Update python2-qrcode

---
 gnu/packages/python.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 775b760..0e2a162 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9070,7 +9070,7 @@ PBKDF2, specified in RSA PKCS#5 v2.0.")
     (source (origin
               (method url-fetch)
               (uri (string-append
-                    "http://pypi.python.org/packages/source/q/qrcode/qrcode-"
+                    "https://pypi.python.org/packages/source/q/qrcode/qrcode-"
                     version ".tar.gz"))
               (sha256
                (base32
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Update python2-qrcode
  2016-06-14 20:00   ` [PATCH] gnu: Update python2-qrcode Daniel Pimentel
@ 2016-06-14 21:12     ` ng0
  2016-06-14 21:48       ` d4n1
  2016-06-16 12:14     ` [PATCH] gnu: Update python2-qrcode (refactored) Daniel Pimentel
  1 sibling, 1 reply; 14+ messages in thread
From: ng0 @ 2016-06-14 21:12 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

On 2016-06-14(05:00:11-0300), Daniel Pimentel wrote:
> > Could you use https://pypi.python.org/packages/source/q/qrcode/qrcode-"
> > instead of the http uri?
>
> Done!
>
> Thanks :)
>
> --
> Daniel Pimentel (aka d4n1)

> From 55137a720f4642fff0b67d91e37887e1ae14b8c5 Mon Sep 17 00:00:00 2001
> From: Daniel Pimentel <d4n1@d4n1.org>
> Date: Tue, 14 Jun 2016 16:58:31 -0300
> Subject: [PATCH 7/7] gnu: Update python2-qrcode
>
> ---
>  gnu/packages/python.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index 775b760..0e2a162 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -9070,7 +9070,7 @@ PBKDF2, specified in RSA PKCS#5 v2.0.")
>      (source (origin
>                (method url-fetch)
>                (uri (string-append
> -                    "http://pypi.python.org/packages/source/q/qrcode/qrcode-"
> +                    "https://pypi.python.org/packages/source/q/qrcode/qrcode-"
>                      version ".tar.gz"))
>                (sha256
>                 (base32
> --
> 2.7.4
>

Thanks.

I think it's more welcome if you sent in just one initial patch for a package,
not a patch based on another patch.

--
♥Ⓐ ng0
For non-prism friendly talk find me on
psyced.org / loupsycedyglgamf.onion

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Update python2-qrcode
  2016-06-14 21:12     ` ng0
@ 2016-06-14 21:48       ` d4n1
  2016-06-15 13:12         ` Andreas Enge
  0 siblings, 1 reply; 14+ messages in thread
From: d4n1 @ 2016-06-14 21:48 UTC (permalink / raw)
  To: ng0, guix-devel

[-- Attachment #1: Type: text/html, Size: 2648 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Update python2-qrcode
  2016-06-14 21:48       ` d4n1
@ 2016-06-15 13:12         ` Andreas Enge
  0 siblings, 0 replies; 14+ messages in thread
From: Andreas Enge @ 2016-06-15 13:12 UTC (permalink / raw)
  To: d4n1; +Cc: guix-devel

Hello,

On Tue, Jun 14, 2016 at 06:48:22PM -0300, d4n1 wrote:
> OK. I'll rebuild packages and send a complete patch.
>     >                (uri (string-append
>     > +                    "https://pypi.python.org/packages/source/q/qrcode/
>     qrcode-"

should this not be something along the lines of
   (uri (pypi-uri "responses" version))
of which there are lots of examples in python.scm?

Andreas

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Update python2-qrcode (refactored)
  2016-06-14 20:00   ` [PATCH] gnu: Update python2-qrcode Daniel Pimentel
  2016-06-14 21:12     ` ng0
@ 2016-06-16 12:14     ` Daniel Pimentel
  2016-06-16 22:08       ` Ben Woodcroft
  2016-06-17 23:47       ` [PATCH 2/2] gnu: Update python2-qrcode Daniel Pimentel
  1 sibling, 2 replies; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-16 12:14 UTC (permalink / raw)
  To: guix-devel; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 50 bytes --]

Add python2-qrcode

-- 
Daniel Pimentel (aka d4n1)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-Add-python2-qrcode.patch --]
[-- Type: text/x-diff; name=0003-gnu-Add-python2-qrcode.patch, Size: 1669 bytes --]

From 73789bcc6b019f8688881361b12ca451282efe43 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Thu, 16 Jun 2016 09:13:55 -0300
Subject: [PATCH 3/3] gnu: Add python2-qrcode

---
 gnu/packages/python.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0d1391b..db65ffc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9269,3 +9269,29 @@ new (proposed) 2.0 spec, which includes batch submission, keyword arguments,
      "This module implements the password-based key derivation function, 
 PBKDF2, specified in RSA PKCS#5 v2.0.")
     (license license:expat)))
+
+(define-public python2-qrcode
+  (package
+    (name "python2-qrcode")
+    (version "5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://pypi.python.org/packages/source/q/qrcode/qrcode-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0skzrvhjnnacrz52jml4i050vdx5lfcd3np172srxjaghdgfxg9k"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-setuptools" ,python2-setuptools)
+       ("python2-pillow" ,python2-pillow)
+       ("python2-six" ,python2-six)))    
+    (arguments
+     `(#:python ,python-2)) ; only Python 2.7 is supported
+    (home-page "https://pypi.python.org/pypi/qrcode")
+    (synopsis "Python library to generate QR Codes")
+    (description
+     "Python library that uses image libraries, Python Imaging Library (PIL) 
+by default, to generate QR Codes.")
+    (license license:expat)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Update python2-qrcode (refactored)
  2016-06-16 12:14     ` [PATCH] gnu: Update python2-qrcode (refactored) Daniel Pimentel
@ 2016-06-16 22:08       ` Ben Woodcroft
  2016-06-17 23:40         ` [PATCH 2/2] gnu: Update python2-qrcode Daniel Pimentel
  2016-06-17 23:47       ` [PATCH 2/2] gnu: Update python2-qrcode Daniel Pimentel
  1 sibling, 1 reply; 14+ messages in thread
From: Ben Woodcroft @ 2016-06-16 22:08 UTC (permalink / raw)
  To: Daniel Pimentel, guix-devel

Hi Daniel,

Thanks for the patch.

> Subject: [PATCH 3/3] gnu: Add python2-qrcode

nitpicks: A full stop should be added at the end, and the following 
changelog-style line should be added:

* gnu/packages/python.scm (python2-qrcode): New variable.

There was also some trailing whitespace in the patch.

> +
> +(define-public python2-qrcode
> +  (package
> +    (name "python2-qrcode")
> +    (version "5.1")

5.3 is the newest version, is there a reason to stick with this older 
version?

> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> + "https://pypi.python.org/packages/source/q/qrcode/qrcode-"
> +                    version ".tar.gz"))

I think Andreas' comment still applies here i.e. better to use 'pypi-url'.

> +              (sha256
> +               (base32
> + "0skzrvhjnnacrz52jml4i050vdx5lfcd3np172srxjaghdgfxg9k"))))
> +    (build-system python-build-system)
> +    (inputs
> +     `(("python2-setuptools" ,python2-setuptools)

Can we make this a native-input ?

> +       ("python2-pillow" ,python2-pillow)

I agree this should be an input, even if it is optional. However, it 
does not get included in the .pth file, does this mean that it is not 
available as usual in an environment. Would you mind please checking this?

> +       ("python2-six" ,python2-six)))
> +    (arguments
> +     `(#:python ,python-2)) ; only Python 2.7 is supported
> +    (home-page "https://pypi.python.org/pypi/qrcode")
> +    (synopsis "Python library to generate QR Codes")
> +    (description
> +     "Python library that uses image libraries, Python Imaging 
> Library (PIL)
> +by default, to generate QR Codes.")

How about "qrcode is a library which can be used to generate Quick 
Response (QR) images.  It is recommended that the pillow library be used 
to generate images, though the default Python imaging library can also 
be used.

> +    (license license:expat)))

This should be bsd-3 I think.

Thanks,
ben

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] gnu: Update python2-qrcode
  2016-06-16 22:08       ` Ben Woodcroft
@ 2016-06-17 23:40         ` Daniel Pimentel
  2016-06-18  5:31           ` Ben Woodcroft
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-17 23:40 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

> * gnu/packages/python.scm (python2-qrcode): New variable.

done

> I think Andreas' comment still applies here i.e. better to use 
> 'pypi-url'.

done

> Can we make this a native-input ?

done

> This should be bsd-3 I think.

done

Thanks for your comments.

I

-- 
Daniel Pimentel (aka d4n1)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-Add-python2-qrcode.patch --]
[-- Type: text/x-diff; name=0004-Add-python2-qrcode.patch, Size: 1871 bytes --]

From 168d071bfc7a2e15f51ec0d8b5fe3f458cce69a8 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Fri, 17 Jun 2016 20:31:51 -0300
Subject: [PATCH 4/4] Add python2-qrcode * gnu/packages/python.scm
 (python2-qrcode): New variable.

---
 gnu/packages/python.scm | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index db65ffc..dc98306 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9273,25 +9273,24 @@ PBKDF2, specified in RSA PKCS#5 v2.0.")
 (define-public python2-qrcode
   (package
     (name "python2-qrcode")
-    (version "5.1")
+    (version "5.3")
     (source (origin
               (method url-fetch)
-              (uri (string-append
-                    "https://pypi.python.org/packages/source/q/qrcode/qrcode-"
-                    version ".tar.gz"))
+              (uri (pypi-uri "qrcode" version))
               (sha256
                (base32
                 "0skzrvhjnnacrz52jml4i050vdx5lfcd3np172srxjaghdgfxg9k"))))
     (build-system python-build-system)
     (inputs
-     `(("python2-setuptools" ,python2-setuptools)
-       ("python2-pillow" ,python2-pillow)
-       ("python2-six" ,python2-six)))    
+     `(("python2-pillow" ,python2-pillow)
+       ("python2-six" ,python2-six)))
+    (native-inputs
+     `(("python2-setuptools" ,python2-setuptools)))
     (arguments
-     `(#:python ,python-2)) ; only Python 2.7 is supported
+     `(#:python ,python-2))
     (home-page "https://pypi.python.org/pypi/qrcode")
     (synopsis "Python library to generate QR Codes")
     (description
      "Python library that uses image libraries, Python Imaging Library (PIL) 
-by default, to generate QR Codes.")
-    (license license:expat)))
+by default or Pillow, to generate QR Codes.")
+    (license bsd-3)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] gnu: Update python2-qrcode
  2016-06-16 12:14     ` [PATCH] gnu: Update python2-qrcode (refactored) Daniel Pimentel
  2016-06-16 22:08       ` Ben Woodcroft
@ 2016-06-17 23:47       ` Daniel Pimentel
  1 sibling, 0 replies; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-17 23:47 UTC (permalink / raw)
  To: guix-devel; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 60 bytes --]

Add pypi-uri python2-qrcode.

-- 
Daniel Pimentel (aka d4n1)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0005-add-python2-pbkdf2.patch --]
[-- Type: text/x-diff; name=0005-add-python2-pbkdf2.patch, Size: 984 bytes --]

From 900f78a825b2c9297eb4c4e1f4b7672cd653fc02 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Fri, 17 Jun 2016 20:45:22 -0300
Subject: [PATCH 5/5] add python2-pbkdf2 * gnu/packages/python.scm: add
 pypi-uri.

---
 gnu/packages/python.scm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index dc98306..21cb0c7 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9251,9 +9251,7 @@ new (proposed) 2.0 spec, which includes batch submission, keyword arguments,
     (version "1.3")
     (source (origin
               (method url-fetch)
-              (uri (string-append
-                    "https://pypi.python.org/packages/source/p/pbkdf2/pbkdf2-"
-                    version ".tar.gz"))
+              (uri (pypi-uri "pbkdf2" version))
               (sha256
                (base32
                 "0yb99rl2mbsaamj571s1mf6vgniqh23v98k4632150hjkwv9fqxc"))))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] gnu: Update python2-qrcode
  2016-06-17 23:40         ` [PATCH 2/2] gnu: Update python2-qrcode Daniel Pimentel
@ 2016-06-18  5:31           ` Ben Woodcroft
  2016-06-23 16:14             ` Daniel Pimentel
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Woodcroft @ 2016-06-18  5:31 UTC (permalink / raw)
  To: Daniel Pimentel; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

Hi Daniel,

On 18/06/16 09:40, Daniel Pimentel wrote:
>> * gnu/packages/python.scm (python2-qrcode): New variable.

Thanks for the updated patch. In future would you mind sending the whole 
patch like as attached? It just makes things easier - thanks.

I noticed that the sha256 did not change, so I changed the source field. 
But perhaps more problematically, I couldn't get the example in the 
README to work. Do you know if this is a problem with the library itself 
or the packing of it?

$ ./pre-inst-env guix environment --pure --ad-hoc python2-qrcode python@2
...
$ python
Python 2.7.10 (default, Jan  1 1970, 00:00:01)
[GCC 4.9.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import qrcode
>>> img = qrcode.make('Some data here')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File 
"/gnu/store/n205hrfqrc0mp1csbh44mxpm19hrggld-profile/lib/python2.7/site-packages/qrcode-5.3-py2.7.egg/qrcode/main.py", 
line 11, in make
   File 
"/gnu/store/n205hrfqrc0mp1csbh44mxpm19hrggld-profile/lib/python2.7/site-packages/qrcode-5.3-py2.7.egg/qrcode/main.py", 
line 271, in make_image
   File 
"/gnu/store/n205hrfqrc0mp1csbh44mxpm19hrggld-profile/lib/python2.7/site-packages/qrcode-5.3-py2.7.egg/qrcode/image/pil.py", 
line 8, in <module>
ImportError: No module named Image



[-- Attachment #2: 0001-gnu-Add-python2-qrcode.patch --]
[-- Type: text/x-patch, Size: 1801 bytes --]

From 63500efe49a1a9bea44857471e094bdff38fdc45 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sat, 18 Jun 2016 15:04:01 +1000
Subject: [PATCH] gnu: Add python2-qrcode.

* gnu/packages/python.scm (python2-qrcode): New variable.
---
 gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b294814..26fef4b 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9281,3 +9281,34 @@ It supports both the original 1.0 specification, as well as the
 new (proposed) 2.0 spec, which includes batch submission, keyword arguments,
 etc.")
     (license asl2.0)))
+
+(define-public python2-qrcode
+  (package
+    (name "python2-qrcode")
+    (version "5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://pypi.python.org/packages/"
+         "87/16/99038537dc58c87b136779c0e06d46887ff5104eb8c64989aac1ec8cba81"
+         "/qrcode-" version ".tar.gz"))
+      (sha256
+        (base32
+          "0kljfrfq0c2rmxf8am57333ia41kd0snbm2rnqbdy816hgpcq5a1"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-pillow" ,python2-pillow)
+       ("python2-six" ,python2-six)))
+    (native-inputs
+     `(("python2-setuptools" ,python2-setuptools)))
+    (arguments
+     `(#:python ,python-2))
+    (home-page "https://pypi.python.org/pypi/qrcode")
+    (synopsis "Python library to generate QR Codes")
+    (description
+     "@code{qrcode} is a library which can be used to generate Quick
+Response (QR) images.  It is recommended that the pillow library be used to
+generate images, though the default Python imaging library can also be used.")
+    (license bsd-3)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] gnu: Update python2-qrcode
  2016-06-18  5:31           ` Ben Woodcroft
@ 2016-06-23 16:14             ` Daniel Pimentel
  2016-06-23 16:41               ` [PATCH] gnu: Add python2-qrcode Daniel Pimentel
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-23 16:14 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel

> Thanks for the updated patch. In future would you mind sending the
> whole patch like as attached? It just makes things easier - thanks.

Ok, thanks

> I noticed that the sha256 did not change, so I changed the source
> field. But perhaps more problematically, I couldn't get the example in
> the README to work. Do you know if this is a problem with the library
> itself or the packing of it?
> 
> $ ./pre-inst-env guix environment --pure --ad-hoc python2-qrcode 
> python@2
> ...
> $ python
> Python 2.7.10 (default, Jan  1 1970, 00:00:01)
> [GCC 4.9.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import qrcode
>>>> img = qrcode.make('Some data here')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/gnu/store/n205hrfqrc0mp1csbh44mxpm19hrggld-profile/lib/python2.7/site-packages/qrcode-5.3-py2.7.egg/qrcode/main.py",
> line 11, in make
>   File
> "/gnu/store/n205hrfqrc0mp1csbh44mxpm19hrggld-profile/lib/python2.7/site-packages/qrcode-5.3-py2.7.egg/qrcode/main.py",
> line 271, in make_image
>   File
> "/gnu/store/n205hrfqrc0mp1csbh44mxpm19hrggld-profile/lib/python2.7/site-packages/qrcode-5.3-py2.7.egg/qrcode/image/pil.py",
> line 8, in <module>
> ImportError: No module named Image

I tried it and I had the same error. I'll try again and I'll fix it.

Thank you for your feedbacks.

-- 
Daniel Pimentel (aka d4n1)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] gnu: Add python2-qrcode
  2016-06-23 16:14             ` Daniel Pimentel
@ 2016-06-23 16:41               ` Daniel Pimentel
  2016-06-23 23:45                 ` Ben Woodcroft
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Pimentel @ 2016-06-23 16:41 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

In attach a full patch. Update URI with Pypi.

I tried:
./pre-inst-env guix environment --pure --ad-hoc python2-qrcode python@2
$ qr "Guix" > guix-qrcode.png

It's work.

But whent import by python shell using:
$ python
> import qrcode
> img = qrcode.make('Some data here')

Not work, probably problem with Pillow (PIL fork).

-- 
Daniel Pimentel (aka d4n1)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-add-python2-qrcode.patch --]
[-- Type: text/x-diff; name=0002-gnu-add-python2-qrcode.patch, Size: 1570 bytes --]

From c2a15eb90e42e2020d38161f51bca1c800d12139 Mon Sep 17 00:00:00 2001
From: Daniel Pimentel <d4n1@d4n1.org>
Date: Thu, 23 Jun 2016 13:34:54 -0300
Subject: [PATCH 2/2] gnu: add python2-qrcode * gnu/packages/python.scm: add
 new package.

---
 gnu/packages/python.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index cf4ef3c..529da2c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -9315,3 +9315,30 @@ etc.")
      "A module that implements the password-based key derivation 
 function PBKDF2.")
     (license license:expat)))
+
+(define-public python2-qrcode
+  (package
+    (name "python2-qrcode")
+    (version "5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "qrcode" version))
+       (sha256
+        (base32
+         "0kljfrfq0c2rmxf8am57333ia41kd0snbm2rnqbdy816hgpcq5a1"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-pillow" ,python2-pillow)
+       ("python2-six" ,python2-six)))
+    (native-inputs
+     `(("python2-setuptools" ,python2-setuptools)))
+    (arguments
+     `(#:python ,python-2))
+    (home-page "https://pypi.python.org/pypi/qrcode")
+    (synopsis "Python library to generate QR Codes")
+    (description
+     "@code{qrcode} is a library which can be used to generate Quick
+Response (QR) images.  It is recommended that the pillow library be used to
+generate images, though the default Python imaging library can also be used.")
+    (license bsd-3)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] gnu: Add python2-qrcode
  2016-06-23 16:41               ` [PATCH] gnu: Add python2-qrcode Daniel Pimentel
@ 2016-06-23 23:45                 ` Ben Woodcroft
  0 siblings, 0 replies; 14+ messages in thread
From: Ben Woodcroft @ 2016-06-23 23:45 UTC (permalink / raw)
  To: Daniel Pimentel; +Cc: guix-devel



On 24/06/16 02:41, Daniel Pimentel wrote:
> In attach a full patch. Update URI with Pypi.
>
> I tried:
> ./pre-inst-env guix environment --pure --ad-hoc python2-qrcode python@2
> $ qr "Guix" > guix-qrcode.png
>
> It's work.
>
> But whent import by python shell using:
> $ python
>> import qrcode
>> img = qrcode.make('Some data here')
>
> Not work, probably problem with Pillow (PIL fork).

In cases like this I tend to test outside Guix and see if it works 
there, and if it doesn't work, then report the bug upstream.

OTOH, if it does work, then that points to something amiss with the Guix 
package or its dependencies.

Would you be able to test please? Given that this seems on the face of 
it to be a central part of this package it would be good to know why the 
package isn't working.
Thanks,
ben

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-06-23 23:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14 19:26 [PATCH] gnu: Add python2-qrcode Daniel Pimentel
2016-06-14 19:51 ` ng0
2016-06-14 20:00   ` [PATCH] gnu: Update python2-qrcode Daniel Pimentel
2016-06-14 21:12     ` ng0
2016-06-14 21:48       ` d4n1
2016-06-15 13:12         ` Andreas Enge
2016-06-16 12:14     ` [PATCH] gnu: Update python2-qrcode (refactored) Daniel Pimentel
2016-06-16 22:08       ` Ben Woodcroft
2016-06-17 23:40         ` [PATCH 2/2] gnu: Update python2-qrcode Daniel Pimentel
2016-06-18  5:31           ` Ben Woodcroft
2016-06-23 16:14             ` Daniel Pimentel
2016-06-23 16:41               ` [PATCH] gnu: Add python2-qrcode Daniel Pimentel
2016-06-23 23:45                 ` Ben Woodcroft
2016-06-17 23:47       ` [PATCH 2/2] gnu: Update python2-qrcode Daniel Pimentel

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).