unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vinicius Monego <monego@posteo.net>
To: 43233@debbugs.gnu.org
Cc: Vinicius Monego <monego@posteo.net>
Subject: [bug#43233] [PATCH 01/10] gnu: Add python-httptools.
Date: Sun,  6 Sep 2020 02:45:03 -0300	[thread overview]
Message-ID: <20200906054503.65491-1-monego@posteo.net> (raw)

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

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 42b2bbc1a1..5dc7430bde 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3957,6 +3957,55 @@ and fairly speedy.")
     (properties '((hidden? . #t)))
     (native-inputs `())))
 
+(define-public python-httptools
+  (package
+    (name "python-httptools")
+    (version "0.1.1")
+    (source
+     (origin
+       ;; PyPI tarball comes with a vendored http-parser and no tests.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/MagicStack/httptools")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0g08128x2ixsiwrzskxc6c8ymgzs39wbzr5mhy0mjk30q9pqqv77"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda _
+             ;; Skip a failing test (AssertionError).  Bug report:
+             ;; https://github.com/MagicStack/httptools/issues/10.
+             (substitute* "tests/test_parser.py"
+               (("    def test_parser_response_1")
+                (string-append
+                 "    @unittest.skip(\"Disabled.\")\n"
+                 "    def test_parser_response_1")))
+             ;; Use packaged http-parser.
+             (substitute* "setup.py" (("self.use_system_http_parser = False")
+                                      "self.use_system_http_parser = True"))
+             ;; This path is hardcoded.  Hardcode our own.
+             (substitute* "httptools/parser/cparser.pxd"
+               (("../../vendor/http-parser")
+                (string-append (assoc-ref %build-inputs "http-parser")
+                               "/include")))
+             ;; Don't force Cython version.
+             (substitute* "setup.py" (("Cython==") "Cython>="))
+             #t)))))
+    (native-inputs
+     `(("python-cython" ,python-cython)
+       ("python-pytest" ,python-pytest)))
+    (inputs
+     `(("http-parser" ,http-parser)))
+    (home-page "https://github.com/MagicStack/httptools")
+    (synopsis "Collection of framework independent HTTP protocol utils")
+    (description
+     "@code{httptools} is a Python binding for the nodejs HTTP parser.")
+    (license license:expat)))
+
 (define-public python-translation-finder
   (package
     (name "python-translation-finder")
-- 
2.20.1





             reply	other threads:[~2020-09-06  6:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06  5:45 Vinicius Monego [this message]
2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 03/10] gnu: Add python-pytest-toolbox Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 04/10] gnu: Add python-watchgod Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 05/10] gnu: Add python-uvicorn Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 06/10] gnu: Add python-flake8-pie Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 07/10] gnu: Add python-autoflake Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 08/10] gnu: Add python-trio-typing Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 09/10] gnu: Add python-httpcore Vinicius Monego
2020-09-06  5:46   ` [bug#43233] [PATCH 10/10] gnu: Add python-httpx Vinicius Monego
2020-09-07  7:12     ` bug#43233: " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200906054503.65491-1-monego@posteo.net \
    --to=monego@posteo.net \
    --cc=43233@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).