summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinicius Monego <monego@posteo.net>2020-09-06 02:46:53 -0300
committerMathieu Othacehe <othacehe@gnu.org>2020-09-07 09:07:54 +0200
commit32bf0331d14a509b4e673ef10bd49f344cf3cae2 (patch)
tree2339ad92c839a4c3038a55bd856949bcd69021d3
parent7a8025016d524a3b109022e134f4e1217774202a (diff)
gnu: Add python-httpx.
* gnu/packages/python-web.scm (python-httpx): New variable. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
-rw-r--r--gnu/packages/python-web.scm88
1 files changed, 88 insertions, 0 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 96ff861127..2a28bb90c0 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -73,6 +73,7 @@
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-check)
+ #:use-module (gnu packages python-compression)
#:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages serialization)
@@ -4381,6 +4382,93 @@ Some things HTTP Core does do:
@end itemize")
(license license:bsd-3)))
+(define-public python-httpx
+ (package
+ (name "python-httpx")
+ (version "0.14.3")
+ (source
+ (origin
+ ;; PyPI tarball does not contain tests.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/encode/httpx")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0mn8gqkgaij3s2pbwgrih20iq34f3f82dfvypaw3nnh7n63vna43"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (invoke "pytest" "-vv" "-k"
+ ;; This test tries to open an outgoing connection.
+ "not test_connect_timeout[asyncio]"))))))
+ (native-inputs
+ `(("python-autoflake" ,python-autoflake)
+ ("python-black" ,python-black)
+ ("python-cryptography" ,python-cryptography)
+ ("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-trio" ,python-pytest-trio)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-trio" ,python-trio)
+ ("python-trio-typing" ,python-trio-typing)
+ ("python-trustme" ,python-trustme)
+ ("python-uvicorn" ,python-uvicorn)))
+ (propagated-inputs
+ `(("python-brotli" ,python-brotli)
+ ("python-certifi" ,python-certifi)
+ ("python-chardet" ,python-chardet)
+ ("python-httpcore" ,python-httpcore)
+ ("python-idna" ,python-idna)
+ ("python-rfc3986" ,python-rfc3986)
+ ("python-sniffio" ,python-sniffio)))
+ (home-page "https://github.com/encode/httpx")
+ (synopsis "HTTP client for Python")
+ (description
+ "HTTPX is a fully featured HTTP client for Python 3, which provides sync
+and async APIs, and support for both HTTP/1.1 and HTTP/2.
+
+HTTPX builds on the well-established usability of requests, and gives you:
+
+@itemize
+@item A broadly requests-compatible API.
+@item Standard synchronous interface, but with async support if you need it.
+@item HTTP/1.1 and HTTP/2 support.
+@item Ability to make requests directly to WSGI applications or ASGI applications.
+@item Strict timeouts everywhere.
+@item Fully type annotated.
+@item 99% test coverage.
+@end itemize
+
+Plus all the standard features of requests:
+
+@itemize
+@item International Domains and URLs
+@item Keep-Alive & Connection Pooling
+@item Sessions with Cookie Persistence
+@item Browser-style SSL Verification
+@item Basic/Digest Authentication
+@item Elegant Key/Value Cookies
+@item Automatic Decompression
+@item Automatic Content Decoding
+@item Unicode Response Bodies
+@item Multipart File Uploads
+@item HTTP(S) Proxy Support
+@item Connection Timeouts
+@item Streaming Downloads
+@item .netrc Support
+@item Chunked Requests
+@end itemize")
+ (license license:bsd-3)))
+
(define-public python-websockets
(package
(name "python-websockets")