unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#43233] [PATCH 01/10] gnu: Add python-httptools.
@ 2020-09-06  5:45 Vinicius Monego
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
  0 siblings, 1 reply; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:45 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 02/10] gnu: Add python-uvloop.
  2020-09-06  5:45 [bug#43233] [PATCH 01/10] gnu: Add python-httptools Vinicius Monego
@ 2020-09-06  5:46 ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 03/10] gnu: Add python-pytest-toolbox Vinicius Monego
                     ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

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

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 5dc7430bde..49699a7bc5 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -68,6 +68,7 @@
   #:use-module (gnu packages databases)
   #:use-module (gnu packages django)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -3887,6 +3888,43 @@ XPath and therefore does not have all the correctness corner cases that are
 hard or impossible to fix in cssselect.")
     (license license:bsd-3)))
 
+(define-public python-uvloop
+  (package
+    (name "python-uvloop")
+    (version "0.14.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "uvloop" version))
+       (sha256
+        (base32 "07j678z9gf41j98w72ysrnb5sa41pl5yxd7ib17lcwfxqz0cjfhj"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:tests? #f ;FIXME: tests hang and with some errors in the way
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda _
+             ;; Use packaged libuv.
+             (substitute* "setup.py" (("self.use_system_libuv = False")
+                                      "self.use_system_libuv = True"))
+             #t)))))
+    (native-inputs
+     `(("python-aiohttp" ,python-aiohttp)
+       ("python-cython" ,python-cython)
+       ("python-flake8" ,python-flake8)
+       ("python-psutil" ,python-psutil)
+       ("python-pyopenssl" ,python-pyopenssl)
+       ("python-twine" ,python-twine)))
+    (inputs
+     `(("libuv" ,libuv)))
+    (home-page "https://github.com/MagicStack/uvloop")
+    (synopsis "Fast implementation of asyncio event loop on top of libuv")
+    (description
+     "@code{uvloop} is a fast, drop-in replacement of the built-in asyncio
+event loop.  It is implemented in Cython and uses libuv under the hood.")
+    (license license:expat)))
+
 (define-public gunicorn
   (package
     (name "gunicorn")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 03/10] gnu: Add python-pytest-toolbox.
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
@ 2020-09-06  5:46   ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 04/10] gnu: Add python-watchgod Vinicius Monego
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* gnu/packages/python-check.scm (python-pytest-toolbox): New variable.
---
 gnu/packages/python-check.scm | 43 +++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index b8a0d67f3d..c0de32b207 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -698,6 +698,49 @@ rounds that are calibrated to the chosen timer.")
 service processes for your tests with pytest.")
     (license license:expat)))
 
+(define-public python-pytest-toolbox
+  (package
+    (name "python-pytest-toolbox")
+    (version "0.4")
+    (source
+     (origin
+       ;; No tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/samuelcolvin/pytest-toolbox")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1wqkr3g5gmqdxmhzfsxbwy8pm3cadaj6a8cxq58w9bacly4hqbh0"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Make the installed plugin discoverable by Pytest.
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-docutils" ,python-docutils)
+       ("python-flake8" ,python-flake8)
+       ("python-isort" ,python-isort)
+       ("python-pydantic" ,python-pydantic)
+       ("python-pyflakes" ,python-pyflakes)
+       ("python-pygments" ,python-pygments)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-isort" ,python-pytest-isort)
+       ("python-pytest-mock" ,python-pytest-mock)
+       ("python-pytest-sugar" ,python-pytest-sugar)))
+    (home-page "https://github.com/samuelcolvin/pytest-toolbox")
+    (synopsis "Numerous useful plugins for Pytest")
+    (description
+     "Pytest Toolbox contains many useful plugins for Pytest.  Among them are
+new fixtures, new methods and new comparison objects.")
+    (license license:expat)))
+
 (define-public python-pytest-aiohttp
   (package
     (name "python-pytest-aiohttp")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 04/10] gnu: Add python-watchgod.
  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   ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 05/10] gnu: Add python-uvicorn Vinicius Monego
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-watchgod): New variable.
---
 gnu/packages/python-xyz.scm | 43 +++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a4c797cc08..dae1a6e2a8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20343,6 +20343,49 @@ such as a file modification and trigger an action.  This is similar to inotify,
 but portable.")
     (license license:asl2.0)))
 
+(define-public python-watchgod
+  (package
+    (name "python-watchgod")
+    (version "0.6")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/samuelcolvin/watchgod")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1lqx44wkryakgpyqj3m0hsz61bqr07vc7smgzh188374hwvscp66"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-coverage" ,python-coverage)
+       ("python-docutils" ,python-docutils)
+       ("python-flake8" ,python-flake8)
+       ("python-isort" ,python-isort)
+       ("python-pycodestyle" ,python-pycodestyle)
+       ("python-pyflakes" ,python-pyflakes)
+       ("python-pygments" ,python-pygments)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-aiohttp" ,python-pytest-aiohttp)
+       ("python-pytest-mock" ,python-pytest-mock)
+       ("python-pytest-sugar" ,python-pytest-sugar)
+       ("python-pytest-toolbox" ,python-pytest-toolbox)))
+    (home-page "https://github.com/samuelcolvin/watchgod")
+    (synopsis "Simple, modern file watching and code reload in Python")
+    (description
+     "Simple, modern file watching and code reload in Python inspired by
+@code{watchdog}.  Among the differences are a unified approach for each
+operating systems and an elegant approach to concurrency using threading.")
+    (license license:expat)))
+
 (define-public python-wget
   (package
     (name "python-wget")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 05/10] gnu: Add python-uvicorn.
  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   ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 06/10] gnu: Add python-flake8-pie Vinicius Monego
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* gnu/packages/python-web.scm (python-uvicorn): 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 49699a7bc5..d772506607 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -4044,6 +4044,55 @@ and fairly speedy.")
      "@code{httptools} is a Python binding for the nodejs HTTP parser.")
     (license license:expat)))
 
+(define-public python-uvicorn
+  (package
+    (name "python-uvicorn")
+    (version "0.11.8")
+    (source
+     (origin
+       ;; PyPI tarball has no tests.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/encode/uvicorn")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "00iidg5ysp7k00bw3kmkvr8mghnh4jdi0p2ryiarhryf8wz2r3fy"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-black" ,python-black)
+       ("python-codecov" ,python-codecov)
+       ("python-flake8" ,python-flake8)
+       ("python-isort" ,python-isort)
+       ("python-mypy" ,python-mypy)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-mock" ,python-pytest-mock)
+       ("python-requests" ,python-requests)))
+    (propagated-inputs
+     `(("python-click" ,python-click)
+       ("python-h11" ,python-h11)
+       ("python-httptools" ,python-httptools)
+       ("python-pyyaml" ,python-pyyaml)
+       ("python-uvloop" ,python-uvloop)
+       ("python-watchgod" ,python-watchgod)
+       ("python-websockets" ,python-websockets)
+       ("python-wsproto" ,python-wsproto)))
+    (home-page "https://github.com/encode/uvicorn")
+    (synopsis "Lightning-fast ASGI server")
+    (description
+     "@code{uvicorn} is a lightning-fast ASGI server implementation, using
+@code{uvloop} and @code{httptools}.  It currently supports HTTP/1.1 and
+WebSockets.  Support for HTTP/2 is planned.")
+    (license license:bsd-3)))
+
 (define-public python-translation-finder
   (package
     (name "python-translation-finder")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 06/10] gnu: Add python-flake8-pie.
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
                     ` (2 preceding siblings ...)
  2020-09-06  5:46   ` [bug#43233] [PATCH 05/10] gnu: Add python-uvicorn Vinicius Monego
@ 2020-09-06  5:46   ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 07/10] gnu: Add python-autoflake Vinicius Monego
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-flake8-pie): New variable.
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index dae1a6e2a8..2b5d07feb1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8181,6 +8181,24 @@ expressions after the entire file has been read.  This enables support for
 first-class forward references that stub files use.")
     (license license:expat)))
 
+(define-public python-flake8-pie
+  (package
+    (name "python-flake8-pie")
+    (version "0.5.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "flake8-pie" version))
+       (sha256
+        (base32 "0kgipl5gljlp7aa7ykx15pswpzkd0d0qiznihb2z0d9a73181dyd"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/sbdchd/flake8-pie")
+    (synopsis "Flake8 extension that implements lints")
+    (description
+     "This package provides a flake8 extension that implements miscellaneous
+lints.")
+    (license license:bsd-2)))
+
 (define-public python-mistune
   (package
     (name "python-mistune")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 07/10] gnu: Add python-autoflake.
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
                     ` (3 preceding siblings ...)
  2020-09-06  5:46   ` [bug#43233] [PATCH 06/10] gnu: Add python-flake8-pie Vinicius Monego
@ 2020-09-06  5:46   ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 08/10] gnu: Add python-trio-typing Vinicius Monego
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-autoflake): New variable.
---
 gnu/packages/python-xyz.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2b5d07feb1..c82d982372 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8199,6 +8199,30 @@ first-class forward references that stub files use.")
 lints.")
     (license license:bsd-2)))
 
+(define-public python-autoflake
+  (package
+    (name "python-autoflake")
+    (version "1.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "autoflake" version))
+       (sha256
+        (base32 "0nzr057dbmgprp4a52ymafdkdd5zp2wcqf42913xc7hhvvdbj338"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-pyflakes" ,python-pyflakes)))
+    (home-page "https://github.com/myint/autoflake")
+    (synopsis "Removes unused imports and unused variables")
+    (description
+     "@code{autoflake} removes unused imports and unused variables from Python
+code as reported by @code{pyflakes}.
+
+By default, it only removes unused imports for modules that are part of the
+standard library.  Removal of unused variables is also disabled by default.
+It also removes useless @code{pass} statements.")
+    (license license:expat)))
+
 (define-public python-mistune
   (package
     (name "python-mistune")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 08/10] gnu: Add python-trio-typing.
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
                     ` (4 preceding siblings ...)
  2020-09-06  5:46   ` [bug#43233] [PATCH 07/10] gnu: Add python-autoflake Vinicius Monego
@ 2020-09-06  5:46   ` 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
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-trio-typing): New variable.
---
 gnu/packages/python-xyz.scm | 48 +++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c82d982372..e31e7f82fc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19259,6 +19259,54 @@ programs that do multiple things at the same time with parallelized I/O.")
     ;; Either license applies.
     (license (list license:expat license:asl2.0))))
 
+(define-public python-trio-typing
+  (package
+    (name "python-trio-typing")
+    (version "0.5.0")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (pypi-uri "trio-typing" version))
+      (sha256
+       (base32 "1yvlj4vf3wyvp16dw6vyfm4i2idm8lvdc3fvjhi6mhm62zv7s07j"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv"))))))
+    (native-inputs
+     `(("python-attrs" ,python-attrs)
+       ("python-pytest" ,python-pytest)))
+    (propagated-inputs
+     `(("python-mypy" ,python-mypy)
+       ("python-mypy-extensions"
+        ,python-mypy-extensions)
+       ("python-trio" ,python-trio)
+       ("python-typing-extensions"
+        ,python-typing-extensions)))
+    (home-page "https://github.com/python-trio/trio-typing")
+    (synopsis "Static type checking support for Trio and related projects")
+    (description
+     "This package provides:
+
+@itemize
+@item PEP 561 typing stubs packages for the Trio project packages:
+
+@itemize
+@item trio (@code{trio-stubs})
+@item outcome (@code{outcome-stubs})
+@item async_generator (@code{async_generator-stubs})
+@end itemize
+
+@item A package @code{trio_typing} containing types that Trio programs often
+want to refer to (@code{AsyncGenerator[Y, S]} and @code{TaskStatus[T])} and
+a mypy plugin that smooths over some limitations in the basic type hints.
+@end itemize")
+    ;; Either license applies.
+    (license (list license:expat license:asl2.0))))
+
 (define-public python-humanize
   (package
     (name "python-humanize")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 09/10] gnu: Add python-httpcore.
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
                     ` (5 preceding siblings ...)
  2020-09-06  5:46   ` [bug#43233] [PATCH 08/10] gnu: Add python-trio-typing Vinicius Monego
@ 2020-09-06  5:46   ` Vinicius Monego
  2020-09-06  5:46   ` [bug#43233] [PATCH 10/10] gnu: Add python-httpx Vinicius Monego
  7 siblings, 0 replies; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

* 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





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43233] [PATCH 10/10] gnu: Add python-httpx.
  2020-09-06  5:46 ` [bug#43233] [PATCH 02/10] gnu: Add python-uvloop Vinicius Monego
                     ` (6 preceding siblings ...)
  2020-09-06  5:46   ` [bug#43233] [PATCH 09/10] gnu: Add python-httpcore Vinicius Monego
@ 2020-09-06  5:46   ` Vinicius Monego
  2020-09-07  7:12     ` bug#43233: " Mathieu Othacehe
  7 siblings, 1 reply; 11+ messages in thread
From: Vinicius Monego @ 2020-09-06  5:46 UTC (permalink / raw)
  To: 43233; +Cc: Vinicius Monego

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

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4fe637a5c6..82f62975c1 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)
@@ -4380,6 +4381,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 "Next generation HTTP client")
+    (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")
-- 
2.20.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#43233: [PATCH 10/10] gnu: Add python-httpx.
  2020-09-06  5:46   ` [bug#43233] [PATCH 10/10] gnu: Add python-httpx Vinicius Monego
@ 2020-09-07  7:12     ` Mathieu Othacehe
  0 siblings, 0 replies; 11+ messages in thread
From: Mathieu Othacehe @ 2020-09-07  7:12 UTC (permalink / raw)
  To: Vinicius Monego; +Cc: 43233-done


Hello Vinicius,

> * gnu/packages/python-web.scm (python-httpx): New variable.

Nice job! Besides some superlatives in synopsis/descriptions such as
"lightning fast" that I edited, it all looks fine. I pushed the whole
patchset.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-07  7:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` [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

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).