all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Updated patches for gunicorn
@ 2016-09-15 10:54 Hartmut Goebel
  2016-09-15 10:54 ` [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2 Hartmut Goebel
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-15 10:54 UTC (permalink / raw)
  To: guix-devel

As discussed, I updated some comments. Additionally I added building teh
documentation (2nd patch).

Hartmut Goebel (2):
  gnu: Add gunicorn and gunicorn-python2.
  gnu: Build documentation for gunicorn and gunicorn-python2.

 gnu/packages/web.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

-- 
2.7.4

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

* [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2.
  2016-09-15 10:54 [PATCH 0/2] Updated patches for gunicorn Hartmut Goebel
@ 2016-09-15 10:54 ` Hartmut Goebel
  2016-09-18 21:05   ` Efraim Flashner
  2016-09-15 10:54 ` [PATCH 2/2] gnu: Build documentation for " Hartmut Goebel
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-15 10:54 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/web.scm (gunicorn, gunicorn-python2): New variables.
---
 gnu/packages/web.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b9c201d..3841c6b 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Hartmut Goebel <g.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +42,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system perl)
+  #:use-module (guix build-system python)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system r)
   #:use-module (guix build-system trivial)
@@ -3633,3 +3635,56 @@ provides a unix command line interface to a variety of popular www search engine
 and similar services.")
     (home-page "https://surfraw.alioth.debian.org/")
     (license l:public-domain)))
+
+(define-public gunicorn
+  (package
+    (name "gunicorn")
+    (version "19.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "gunicorn" version))
+       (sha256
+        (base32
+         "065n5z91607q4l8wncqkz297cdcb60cz8wnyxy88wk4as4b6jgw1"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'remove-requirements
+           ; setup.py reads test-requirements from a file which is
+           ; pinning to other versions then guix provides. This also
+           ; enforces optional packages like pytst-cov. So clean the
+           ; list.
+           (lambda _
+             (substitute* "requirements_test.txt"
+               ((".*") "")))))))
+    (native-inputs
+     `(("python-setuptools" ,python-setuptools)
+       ; optional test-requirement pytest-cov used only when running
+       ; setup.y with `test --cov`
+       ("python-pytest" ,python-pytest)))
+    (home-page "http://gunicorn.org/")
+    (synopsis "Python WSGI HTTP Server for UNIX")
+    (description "Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP
+Server for UNIX.  It’s a pre-fork worker model ported from Ruby’s
+Unicorn project.  The Gunicorn server is broadly compatible with
+various web frameworks, simply implemented, light on server resources,
+and fairly speedy.")
+  (license l:expat)
+  (properties `((python2-variant . ,(delay gunicorn-python2))))))
+
+(define-public gunicorn-python2
+  (let ((base (package-with-python2
+               (strip-python2-variant gunicorn))))
+    ; Note: byte-compiling gunicorn/workers/_gaiohttp.py with Python 2 raises
+    ; a syntax error, since this is a Python-3-only module. This does not
+    ; matter since that module is not imported in Python 2 anyway.
+    (package
+      (inherit base)
+      (name "gunicorn-python2")
+      (description (string-append (package-description base) "
+
+Use this package if your application is implemented in Python 2."))
+      (native-inputs `(("python2-mock" ,python2-mock)
+                       ,@(package-native-inputs base))))))
-- 
2.7.4

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

* [PATCH 2/2] gnu: Build documentation for gunicorn and gunicorn-python2.
  2016-09-15 10:54 [PATCH 0/2] Updated patches for gunicorn Hartmut Goebel
  2016-09-15 10:54 ` [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2 Hartmut Goebel
@ 2016-09-15 10:54 ` Hartmut Goebel
  2016-09-15 11:27 ` [PATCH 0/2] Updated patches for gunicorn ng0
  2016-09-18  9:07 ` Andreas Enge
  3 siblings, 0 replies; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-15 10:54 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/web.scm (gunicorn): Add build and install documentation
  (html, info, examples).
---
 gnu/packages/web.scm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 3841c6b..e04cce0 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -3648,6 +3648,7 @@ and similar services.")
         (base32
          "065n5z91607q4l8wncqkz297cdcb60cz8wnyxy88wk4as4b6jgw1"))))
     (build-system python-build-system)
+    (outputs '("out" "doc"))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -3658,12 +3659,36 @@ and similar services.")
            ; list.
            (lambda _
              (substitute* "requirements_test.txt"
-               ((".*") "")))))))
+               ((".*") ""))))
+         (add-after 'build 'build-doc
+           (lambda _
+             (zero? (system* "make" "-C" "docs" "PAPER=a4"
+                             "html" "info"))
+             (delete-file "docs/build/texinfo/Makefile")
+             (delete-file "docs/build/texinfo/Gunicorn.texi")))
+        (add-after 'install 'install-doc
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((doc (string-append (assoc-ref outputs "doc")
+                                       "/share/doc/" ,name "-" ,version))
+                   (html (string-append doc "/html"))
+                   (info (string-append doc "/info"))
+                   (examples (string-append doc "/examples")))
+              (mkdir-p html)
+              (mkdir-p info)
+              (mkdir-p examples)
+              (copy-recursively "docs/build/html" html)
+              (copy-recursively "docs/build/texinfo" info)
+              (copy-recursively "examples" examples)
+              (for-each (lambda (file)
+                          (copy-file file (string-append doc "/" file)))
+                        '("README.rst" "NOTICE" "LICENSE" "THANKS"))))))))
     (native-inputs
      `(("python-setuptools" ,python-setuptools)
        ; optional test-requirement pytest-cov used only when running
        ; setup.y with `test --cov`
-       ("python-pytest" ,python-pytest)))
+       ("python-pytest" ,python-pytest)
+       ("python-sphinx" ,python-sphinx)
+       ("texinfo" ,texinfo)))
     (home-page "http://gunicorn.org/")
     (synopsis "Python WSGI HTTP Server for UNIX")
     (description "Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP
-- 
2.7.4

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-15 10:54 [PATCH 0/2] Updated patches for gunicorn Hartmut Goebel
  2016-09-15 10:54 ` [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2 Hartmut Goebel
  2016-09-15 10:54 ` [PATCH 2/2] gnu: Build documentation for " Hartmut Goebel
@ 2016-09-15 11:27 ` ng0
  2016-09-15 12:03   ` Hartmut Goebel
  2016-09-18  9:07 ` Andreas Enge
  3 siblings, 1 reply; 11+ messages in thread
From: ng0 @ 2016-09-15 11:27 UTC (permalink / raw)
  To: Hartmut Goebel, guix-devel

Hi,

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> As discussed, I updated some comments. Additionally I added building teh
> documentation (2nd patch).

Thanks. One question, can't they be squashed so that it's just one
initial commit?

> Hartmut Goebel (2):
>   gnu: Add gunicorn and gunicorn-python2.
>   gnu: Build documentation for gunicorn and gunicorn-python2.
>
>  gnu/packages/web.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 80 insertions(+)
>
> -- 
> 2.7.4
>
>
>

-- 
              ng0

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-15 11:27 ` [PATCH 0/2] Updated patches for gunicorn ng0
@ 2016-09-15 12:03   ` Hartmut Goebel
  0 siblings, 0 replies; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-15 12:03 UTC (permalink / raw)
  To: ng0, guix-devel

Am 15.09.2016 um 13:27 schrieb ng0:
> Thanks. One question, can't they be squashed so that it's just one
> initial commit?

It can. I split it up to make it easier compare the changes to my first
attempt.

Whoever will commit the patch: feel free to merge it.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-15 10:54 [PATCH 0/2] Updated patches for gunicorn Hartmut Goebel
                   ` (2 preceding siblings ...)
  2016-09-15 11:27 ` [PATCH 0/2] Updated patches for gunicorn ng0
@ 2016-09-18  9:07 ` Andreas Enge
  2016-09-18  9:19   ` Hartmut Goebel
  2016-09-18  9:19   ` Hartmut Goebel
  3 siblings, 2 replies; 11+ messages in thread
From: Andreas Enge @ 2016-09-18  9:07 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hello,

On Thu, Sep 15, 2016 at 12:54:51PM +0200, Hartmut Goebel wrote:
> As discussed, I updated some comments. Additionally I added building teh
> documentation (2nd patch).
> Hartmut Goebel (2):
>   gnu: Add gunicorn and gunicorn-python2.

sorry for being late to the discussion. We build python2 versions of
"libraries" so that people can use them in their own scripts. In the
case of something that is supposed to be used essentially as a binary,
I do not think it is useful to add a second binary built with the old
python, and that one package would be enough.

What do you think?

Andreas

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-18  9:07 ` Andreas Enge
@ 2016-09-18  9:19   ` Hartmut Goebel
  2016-09-18  9:47     ` Andreas Enge
  2016-09-18  9:19   ` Hartmut Goebel
  1 sibling, 1 reply; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-18  9:19 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Am 18.09.2016 um 11:07 schrieb Andreas Enge:
> sorry for being late to the discussion. We build python2 versions of
> "libraries" so that people can use them in their own scripts. In the
> case of something that is supposed to be used essentially as a binary,
> I do not think it is useful to add a second binary built with the old
> python, and that one package would be enough.
>
> What do you think?

Well, gunicorn is a application server for running applications written
in python. So if the application is written in Python 2, one needs to
run the application server using Python 2, too, since it does not spawn
a new interpreter-process [*]. This is why there are two packages.

[*] Even if it would spawn a new interpreter process, we would need a
second package, since for a Python 2 application gunicorn would need to
access the python2 binary or library.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-18  9:07 ` Andreas Enge
  2016-09-18  9:19   ` Hartmut Goebel
@ 2016-09-18  9:19   ` Hartmut Goebel
  1 sibling, 0 replies; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-18  9:19 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Am 18.09.2016 um 11:07 schrieb Andreas Enge:
> sorry for being late to the discussion. We build python2 versions of
> "libraries" so that people can use them in their own scripts. In the
> case of something that is supposed to be used essentially as a binary,
> I do not think it is useful to add a second binary built with the old
> python, and that one package would be enough.
>
> What do you think?

Well, gunicorn is a application server for running applications written
in python. So if the application is written in Python 2, one needs to
run the application server using Python 2, too, since it does not spawn
a new interpreter-process [*]. This is why there are two packages.

[*] Even if it would spawn a new interpreter process, we would need a
second package, since for a Python 2 application gunicorn would need to
access the python2 binary or library.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-18  9:19   ` Hartmut Goebel
@ 2016-09-18  9:47     ` Andreas Enge
  2016-09-18 10:03       ` Hartmut Goebel
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Enge @ 2016-09-18  9:47 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

On Sun, Sep 18, 2016 at 11:19:18AM +0200, Hartmut Goebel wrote:
> Well, gunicorn is a application server for running applications written
> in python. So if the application is written in Python 2, one needs to
> run the application server using Python 2, too, since it does not spawn
> a new interpreter-process [*]. This is why there are two packages.

Okay, I see. Then I would treat it as a "library" and use the
"python(2)-gunicorn" naming convention. The reason we do not do so
for applications is that in general, they appear only once in the
distribution (and generally it does not even matter that they are
written in python).

Andreas

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

* Re: [PATCH 0/2] Updated patches for gunicorn
  2016-09-18  9:47     ` Andreas Enge
@ 2016-09-18 10:03       ` Hartmut Goebel
  0 siblings, 0 replies; 11+ messages in thread
From: Hartmut Goebel @ 2016-09-18 10:03 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Am 18.09.2016 um 11:47 schrieb Andreas Enge:
> Okay, I see. Then I would treat it as a "library" and use the
> "python(2)-gunicorn" naming convention. The reason we do not do so

Feel free to update the patch :-)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

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

* Re: [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2.
  2016-09-15 10:54 ` [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2 Hartmut Goebel
@ 2016-09-18 21:05   ` Efraim Flashner
  0 siblings, 0 replies; 11+ messages in thread
From: Efraim Flashner @ 2016-09-18 21:05 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

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

On Thu, Sep 15, 2016 at 12:54:52PM +0200, Hartmut Goebel wrote:
> * gnu/packages/web.scm (gunicorn, gunicorn-python2): New variables.
> ---
>  gnu/packages/web.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
> 
> diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
> index b9c201d..3841c6b 100644
> --- a/gnu/packages/web.scm
> +++ b/gnu/packages/web.scm
> @@ -14,6 +14,7 @@
>  ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
>  ;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org>
>  ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
> +;;; Copyright © 2016 Hartmut Goebel <g.goebel@crazy-compilers.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -41,6 +42,7 @@
>    #:use-module (guix build-system gnu)
>    #:use-module (guix build-system glib-or-gtk)
>    #:use-module (guix build-system perl)
> +  #:use-module (guix build-system python)
>    #:use-module (guix build-system cmake)
>    #:use-module (guix build-system r)
>    #:use-module (guix build-system trivial)
> @@ -3633,3 +3635,56 @@ provides a unix command line interface to a variety of popular www search engine
>  and similar services.")
>      (home-page "https://surfraw.alioth.debian.org/")
>      (license l:public-domain)))
> +
> +(define-public gunicorn
> +  (package
> +    (name "gunicorn")
> +    (version "19.6.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "gunicorn" version))
> +       (sha256
> +        (base32
> +         "065n5z91607q4l8wncqkz297cdcb60cz8wnyxy88wk4as4b6jgw1"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before 'check 'remove-requirements
> +           ; setup.py reads test-requirements from a file which is
> +           ; pinning to other versions then guix provides. This also
> +           ; enforces optional packages like pytst-cov. So clean the
> +           ; list.
> +           (lambda _
> +             (substitute* "requirements_test.txt"
> +               ((".*") "")))))))

This should return #t

> +    (native-inputs
> +     `(("python-setuptools" ,python-setuptools)
> +       ; optional test-requirement pytest-cov used only when running
> +       ; setup.y with `test --cov`
               ^^^
            setup.py

> +       ("python-pytest" ,python-pytest)))
> +    (home-page "http://gunicorn.org/")
> +    (synopsis "Python WSGI HTTP Server for UNIX")
> +    (description "Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP
> +Server for UNIX.  It’s a pre-fork worker model ported from Ruby’s
> +Unicorn project.  The Gunicorn server is broadly compatible with
> +various web frameworks, simply implemented, light on server resources,
> +and fairly speedy.")
> +  (license l:expat)
> +  (properties `((python2-variant . ,(delay gunicorn-python2))))))
> +
> +(define-public gunicorn-python2
> +  (let ((base (package-with-python2
> +               (strip-python2-variant gunicorn))))
> +    ; Note: byte-compiling gunicorn/workers/_gaiohttp.py with Python 2 raises
> +    ; a syntax error, since this is a Python-3-only module. This does not
> +    ; matter since that module is not imported in Python 2 anyway.
> +    (package
> +      (inherit base)
> +      (name "gunicorn-python2")
> +      (description (string-append (package-description base) "
> +
> +Use this package if your application is implemented in Python 2."))
> +      (native-inputs `(("python2-mock" ,python2-mock)
> +                       ,@(package-native-inputs base))))))
> -- 
> 2.7.4
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-09-18 21:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-15 10:54 [PATCH 0/2] Updated patches for gunicorn Hartmut Goebel
2016-09-15 10:54 ` [PATCH 1/2] gnu: Add gunicorn and gunicorn-python2 Hartmut Goebel
2016-09-18 21:05   ` Efraim Flashner
2016-09-15 10:54 ` [PATCH 2/2] gnu: Build documentation for " Hartmut Goebel
2016-09-15 11:27 ` [PATCH 0/2] Updated patches for gunicorn ng0
2016-09-15 12:03   ` Hartmut Goebel
2016-09-18  9:07 ` Andreas Enge
2016-09-18  9:19   ` Hartmut Goebel
2016-09-18  9:47     ` Andreas Enge
2016-09-18 10:03       ` Hartmut Goebel
2016-09-18  9:19   ` Hartmut Goebel

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.