guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/05: gnu: python-falcon: Update to 2.0.0.


From: guix-commits
Subject: 04/05: gnu: python-falcon: Update to 2.0.0.
Date: Tue, 19 May 2020 13:12:57 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit 45838753bba25e2e6182a15991e3aeaa84d5c44d
Author: Efraim Flashner <address@hidden>
AuthorDate: Tue May 19 16:11:09 2020 +0300

    gnu: python-falcon: Update to 2.0.0.
    
    * gnu/packages/python-web.scm (python-falcon): Update to 2.0.0.
    [source]: Add snippet to remove bundled code.
    [arguments]: Update custom 'check phase.
    [propagated-inputs]: Remove python-six.
    [native-inputs]: Remove python-jsonschema. Add python-mujson,
    python-pytest-runner, python-rapidjson, python-ujson.
    [properties]: New field.
    (python2-falcon)[native-inputs]: Don't add python-rapidjson.
---
 gnu/packages/python-web.scm | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 9ead80f..2cd37c8 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -222,32 +222,50 @@ comes with a SOCKS proxy client.")
 (define-public python-falcon
   (package
     (name "python-falcon")
-    (version "1.4.1")
+    (version "2.0.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "falcon" version))
        (sha256
         (base32
-         "1i0vmqsk24z4biirqhpvas9h28wy7nmpy3jvnb6rz2imq04zd09r"))))
+         "1z6mqfv574x6jiawf67ib52g4kk20c2x7xk7wrn1573b8v7r79gf"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (delete-file-recursively "falcon/vendor")
+           (substitute* "setup.py"
+             ((".*falcon\\.vendor\\.mimeparse.*") ""))
+           (substitute* '("falcon/media/handlers.py"
+                          "falcon/request.py")
+             (("from falcon\\.vendor ") ""))
+           (substitute* "falcon.egg-info/SOURCES.txt"
+             (("falcon/vendor.*") ""))
+           #t))))
     (build-system python-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (replace 'check
-           (lambda _
-             (invoke "pytest"))))))
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Skip orjson, which requires rust to build.
+             (substitute* "tests/test_media_handlers.py"
+               (("== 'CPython") "!= 'CPython"))
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "--ignore" "falcon"))))))
     (propagated-inputs
-     `(("python-mimeparse" ,python-mimeparse)
-       ("python-six" ,python-six)))
+     `(("python-mimeparse" ,python-mimeparse)))
     (native-inputs
      `(("python-cython" ,python-cython) ;for faster binaries
+       ("python-mujson" ,python-mujson)
+       ("python-msgpack" ,python-msgpack)
        ("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner)
        ("python-pyyaml" ,python-pyyaml)
+       ("python-rapidjson" ,python-rapidjson)
        ("python-requests" ,python-requests)
        ("python-testtools" ,python-testtools)
-       ("python-jsonschema" ,python-jsonschema)
-       ("python-msgpack" ,python-msgpack)))
+       ("python-ujson" ,python-ujson)))
     (home-page "https://falconframework.org";)
     (synopsis
      "Web framework for building APIs and application backends")
@@ -267,10 +285,15 @@ classes
 @item Compatible with both CPython and PyPy
 @item Cython support for better performance when used with CPython
 @end itemize")
+    (properties `((python2-variant . ,(delay python2-falcon))))
     (license license:asl2.0)))
 
 (define-public python2-falcon
-  (package-with-python2 python-falcon))
+  (let ((falcon (package-with-python2 (strip-python2-variant python-falcon))))
+    (package
+      (inherit falcon)
+      (native-inputs
+       (alist-delete "python-rapidjson" (package-native-inputs falcon))))))
 
 (define-public python-falcon-cors
   (package



reply via email to

[Prev in Thread] Current Thread [Next in Thread]