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