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 09/10] gnu: Add python-httpcore.
Date: Sun,  6 Sep 2020 02:46:52 -0300	[thread overview]
Message-ID: <20200906054653.467-8-monego@posteo.net> (raw)
In-Reply-To: <20200906054653.467-1-monego@posteo.net>

* gnu/packages/python-web.scm (python-httpcore): New variable.
---
mitmproxy requires python-kaitaistruct which requires kaitai-struct-compiler
which is written in Scala. We don't have a Scala compiler in Guix.
 gnu/packages/python-web.scm | 74 +++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index d772506607..4fe637a5c6 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -4306,6 +4306,80 @@ and serve updated contents upon changes to the directory.")
 @acronym{TLS, Transport Layer Security} support.")
     (license license:bsd-2)))
 
+(define-public python-httpcore
+  (package
+    (name "python-httpcore")
+    (version "0.10.2")
+    (source
+     (origin
+       ;; PyPI tarball does not contain tests.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/encode/httpcore")
+             (commit  version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "00gn8nfv814rg6fj7xv97mrra3fvx6fzjcgx9y051ihm6hxljdsi"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'remove-unavailable-tests
+           (lambda _
+             ;; These tests require 'mitmproxy' which is not packaged.
+             (for-each (lambda (f)
+                         (delete-file f))
+                       '("tests/conftest.py"
+                         "tests/sync_tests/test_interfaces.py"
+                         "tests/async_tests/test_interfaces.py"))
+             #t))
+         (add-after 'remove-unavailable-tests 'force-h11-version
+           ;; Allow build with h11 >= 0.10.
+           (lambda _
+             (substitute* "setup.py" (("h11>=0.8,<0.10") "h11"))
+             #t))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv" "--cov=httpcore" "--cov=tests" "tests"))))))
+    (native-inputs
+     `(;; ("mitmproxy" ,mitmproxy) ;; TODO: Package this.
+       ("python-autoflake" ,python-autoflake)
+       ("python-flake8" ,python-flake8)
+       ("python-flake8-bugbear" ,python-flake8-bugbear)
+       ("python-flake8-pie" ,python-flake8-pie)
+       ("python-isort" ,python-isort)
+       ("python-mypy" ,python-mypy)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-asyncio" ,python-pytest-asyncio)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-trio" ,python-pytest-trio)
+       ("python-uvicorn" ,python-uvicorn)
+       ("python-trustme" ,python-trustme)))
+    (propagated-inputs
+     `(("python-h11" ,python-h11)
+       ("python-h2" ,python-h2)
+       ("python-sniffio" ,python-sniffio)
+       ("python-trio" ,python-trio)
+       ("python-trio-typing" ,python-trio-typing)))
+    (home-page "https://github.com/encode/httpcore")
+    (synopsis "Minimal, low-level HTTP client")
+    (description
+     "HTTP Core provides a minimal and low-level HTTP client, which does one
+thing only: send HTTP requests.
+
+Some things HTTP Core does do:
+
+@itemize
+@item Sending HTTP requests.
+@item Provides both sync and async interfaces.
+@item Supports HTTP/1.1 and HTTP/2.
+@item Async backend support for asyncio and trio.
+@item Automatic connection pooling.
+@item HTTP(S) proxy support.
+@end itemize")
+    (license license:bsd-3)))
+
 (define-public python-websockets
   (package
     (name "python-websockets")
-- 
2.20.1





  parent 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 [bug#43233] [PATCH 01/10] gnu: Add python-httptools Vinicius Monego
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   ` Vinicius Monego [this message]
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=20200906054653.467-8-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).