Subject: Re: [bug#32565] [PATCHv2] Add python-falcon and python-falcon-cors.

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 30 Aug 2018 09:29:15 -0400

Hello,

I've noticed we had a python-web.scm module, so I've moved python-falcon
and python-falcon-cors there instead of in python.scm.

The mimeparse patch can be kept as-is.

Thank you!

>From 88e94dc1e4dec3c1fb9bbf351377c498a351d9ce 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.
---
 gnu/packages/python-web.scm | 41 +++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index fd76c0c60..bb3eccfc0 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -26,6 +26,7 @@
 ;;; Copyright © 2018 Tomáš Čech <[email-masked]>
 ;;; Copyright © 2018 Nicolas Goaziou <[email-masked]>
 ;;; Copyright © 2018 Mathieu Othacehe <[email-masked]>
+;;; Copyright © 2018 Maxim Cournoyer <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -126,6 +127,46 @@ asynchronous DNS resolutions with a synchronous looking interface by
 using @url{https://github.com/saghul/pycares,pycares}.")
     (license license:expat)))
 
+(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-furl
   (package
     (name "python-furl")
-- 
2.18.0

>From 83b94826205a8a7577d2ed1d606367c94d6500d2 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.
---
 gnu/packages/python-web.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index bb3eccfc0..0f2054f1a 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -167,6 +167,29 @@ high-performance microservices, app backends, and higher-level frameworks.")
 (define-public python2-falcon
   (package-with-python2 python-falcon))
 
+(define-public python-falcon-cors
+  (package
+    (name "python-falcon-cors")
+    (version "1.1.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "falcon-cors" version))
+       (sha256
+        (base32
+         "12pym7hwsbd8b0c1azn95nas8gm3f1qpr6lpyx0958xm65ffr20p"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-falcon" ,python-falcon)))
+    (home-page
+     "https://github.com/lwcolton/falcon-cors")
+    (synopsis "Falcon CORS middlware")
+    (description "This middleware provides CORS support for Falcon.")
+    (license l:asl2.0)))
+
+(define-public python2-falcon-cors
+  (package-with-python2 python-falcon-cors))
+
 (define-public python-furl
   (package
     (name "python-furl")
-- 
2.18.0