Subject: bug#32565: closed (Re: [bug#32565] [PATCHv3] Add python-falcon, python-falcon-cors.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 15 Oct 2018 02:59:02 +0000

Your bug report

#32565: [PATCH] Add python-falcon.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32565: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32565
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#32565] [PATCHv3] Add python-falcon, python-falcon-cors.
From: Maxim Cournoyer <[email-masked]>
To: [email-masked] (Ludovic Courtès)
Cc: [email-masked]
Date: Sun, 14 Oct 2018 22:58:05 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Ludovic,

Sorry for keeping you waiting this long, and thank you for the friendly
ping! I've addressed the points of your review below.

[email-masked] (Ludovic Courtès) writes:

> Hi Maxim,
>
> Maxim Cournoyer <[email-masked]> skribis:
>
>>>>From c3a1955a2198310b3c096e539eaaaf57a79aa970 Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <[email-masked]>
>> Date: Wed, 29 Aug 2018 00:06:28 -0400
>> Subject: [PATCH 1/2] gnu: Add python-falcon.
>>
>> * gnu/packages/python-web.scm (python-falcon): New variable.
>
> [...]
>
>> +    (home-page "https://falconframework.org")
>> +    (synopsis
>> +     "Unladen web framework for building APIs and app backends")
>> +    (description
>> +     "Falcon is a bare-metal Python web API framework for building
>> +high-performance microservices, app backends, and higher-level frameworks.")
>
> If you could make it a bit less catchy and more concrete (giving example
> of actual features), that would be great.  :-)

I've modified it like so:

--8<---------------cut here---------------start------------->8---
-     "Unladen web framework for building APIs and app backends")
+     "Web framework for building APIs and application backends")
     (description
-     "Falcon is a bare-metal Python web API framework for building
-high-performance microservices, app backends, and higher-level frameworks.")
+     "Falcon is a web API framework for building microservices, application
+backends and higher-level frameworks.  Among its features are:
+@itemize
+@item Optimized and extensible code base
+@item Routing via URI templates and REST-inspired resource
+classes
+@item Access to headers and bodies through request and response
+classes
+@item Request processing via middleware components and hooks
+@item Idiomatic HTTP error responses
+@item Straightforward exception handling
+@item Unit testing support through WSGI helpers and mocks
+@item Compatible with both CPython and PyPy
+@item Cython support for better performance when used with CPython
+@end itemize")
     (license license:asl2.0)))
--8<---------------cut here---------------end--------------->8---

I mostly took the feature list from their home page and removed some
extraneous adjectives that made it sound overly catchy.

>>>>From 3ecfbe57465aed1062c56ae2b42165a5a07605b5 Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <[email-masked]>
>> Date: Wed, 29 Aug 2018 00:33:17 -0400
>> Subject: [PATCH 2/2] gnu: Add python-falcon-cors.
>>
>> * gnu/packages/python-web.scm (python-falcon-cors): New variable.
>
> [...]
>
>> +    (home-page
>> +     "https://github.com/lwcolton/falcon-cors")
>> +    (synopsis "Falcon CORS middlware")
>                                   ^^
> Typo.

Fixed.

> What about “Falcon @dfn{cross-origin resource sharing} (CORS) library”?

Good idea.

>> +    (description "This middleware provides CORS support for Falcon.")
>
> Ditto here, and bonus points if you add a couple of sentences to explain
> what it does concretely.  :-)

I tried doing so like here:

--8<---------------cut here---------------start------------->8---
-    (synopsis "Falcon CORS middlware")
-    (description "This middleware provides CORS support for Falcon.")
+    (synopsis "Falcon @dfn{cross-origin resource sharing} (CORS) library")
+    (description "This middleware provides @dfn{cross-origin resource
+sharing} (CORS) support for Falcon.  It allows applying a specially crafted
+CORS object to the incoming requests, enabling the ability to serve resources
+over a different origin than that of the web application.")
--8<---------------cut here---------------end--------------->8---

To go further than this would require explaining what CORS is about, which is
not the right place in my opinion :).

> Last point: unless you need them, you can remove the “python2-” variants
> since Python 2.x is reaching end-of-life.

Sadly, yes, I need them.

> OK to push with changes along these lines.

Pushed as 66a9f08bb9c9ba2d7cd4ee3c2d48ea9a8e41c2c4.

Thank you for the review :)

Maxim

Subject: [PATCH] Add python-falcon.
From: Maxim Cournoyer <[email-masked]>
To: guix-patches <[email-masked]>
Date: Wed, 29 Aug 2018 00:10:01 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

This adds Falcon, a Python library for creating web APIs.

Thank you,

Maxim

From 8149807aa4795faa8f3a23f5ed749c6eed1c6522 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <[email-masked]>
Date: Wed, 29 Aug 2018 00:05:07 -0400
Subject: [PATCH 1/2] gnu: python-mimeparse: Update to 1.6.0.

* gnu/packages/python.scm (python-mimeparse): Update to 1.6.0.
[phases]: Enable tests with a custom check phase.
---
 gnu/packages/python.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 33bbc28ed..8e5bee49d 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1669,7 +1669,7 @@ software.")
 (define-public python-mimeparse
   (package
     (name "python-mimeparse")
-    (version "0.1.4")
+    (version "1.6.0")
     (source
      (origin
        (method url-fetch)
@@ -1678,10 +1678,14 @@ software.")
              version ".tar.gz"))
        (sha256
         (base32
-         "1hyxg09kaj02ri0rmwjqi86wk4nd1akvv7n0dx77azz76wga4s9w"))))
+         "0y2g6cl660bpz11srgqyvvm8gmywpgyx8g0xfvbiyr0af0yv1r3n"))))
     (build-system python-build-system)
     (arguments
-     '(#:tests? #f)) ; no setup.py test command
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "./mimeparse_test.py"))))))
     (home-page
      "https://github.com/dbtsai/python-mimeparse")
     (synopsis "Python library for parsing MIME types")
-- 
2.18.0

From a43e42b5e962684143023b67f994a8522700a640 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <[email-masked]>
Date: Wed, 29 Aug 2018 00:06:28 -0400
Subject: [PATCH 2/2] gnu: Add python-falcon.

* gnu/packages/web.scm (python-falcon): New variable.
---
 gnu/packages/web.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index aea75654b..2912c94f8 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -3794,6 +3794,46 @@ http://opensearch.a9.com} compatible search engines.")
 their web site.")
     (home-page "https://metacpan.org/release/WWW-RobotRules")))
 
+(define-public python-falcon
+  (package
+    (name "python-falcon")
+    (version "1.4.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "falcon" version))
+       (sha256
+        (base32
+         "1i0vmqsk24z4biirqhpvas9h28wy7nmpy3jvnb6rz2imq04zd09r"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest"))))))
+    (propagated-inputs
+     `(("python-mimeparse" ,python-mimeparse)
+       ("python-six" ,python-six)))
+    (native-inputs
+     `(("python-cython" ,python-cython) ;for faster binaries
+       ("python-pytest" ,python-pytest)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-requests" ,python-requests)
+       ("python-testtools" ,python-testtools)
+       ("python-jsonschema" ,python-jsonschema)
+       ("python-msgpack" ,python-msgpack)))
+    (home-page "https://falconframework.org")
+    (synopsis
+     "Unladen web framework for building APIs and app backends")
+    (description
+     "Falcon is a bare-metal Python web API framework for building
+high-performance microservices, app backends, and higher-level frameworks.")
+    (license l:asl2.0)))
+
+(define-public python2-falcon
+  (package-with-python2 python-falcon))
+
 (define-public python-feedparser
   (package
     (name "python-feedparser")
-- 
2.18.0