diff mbox series

[bug#48427,3/5] gnu: Add python-aiostream.

Message ID 20210514211746.143145-3-stefan@xsteve.at
State New
Headers show
Series [bug#48428,1/5] gnu: python-pyte: Update to 0.8.0. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Stefan Reichör May 14, 2021, 9:17 p.m. UTC
* gnu/packages/python-xyz.scm (python-aiostream): New variable.
---
 gnu/packages/python-xyz.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Vinicius Monego May 18, 2021, 10:31 p.m. UTC | #1
Hi,

Em sex, 2021-05-14 às 23:17 +0200, Stefan Reichör escreveu:
> * gnu/packages/python-xyz.scm (python-aiostream): New variable.

Thank you.

> 
> +(define-public python-aiostream
> +  (package
> +    (name "python-aiostream")
> +    (version "0.4.3")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (pypi-uri "aiostream" version))
> +        (sha256
> +          (base32
> +           
> "1k33bxrp24pa7c3hygzkv0lqvjil689aj442hzhgzv8vsbqmwd1n"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:tests? #f)) ; tests fail, not sure why

Tests are not included in the PyPI tarball. That happens often in the
Python ecosystem, and in those cases we fetch directly from the
upstream repository.

After changing the source and adding #:test-target "pytest" to the
arguments (requires python-pytest-runner which is already there), I
could succesfully build the project with tests:

    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/vxgmichel/aiostream")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
"1r3x9qwl08yscmzvhafc6gsmq84lr17s6p7a1qxr49cmdvjzsc13"))))
    (arguments
     `(#:test-target "pytest"))

Note that python-build-system will run "python setup.py test" which is
used for unittest tests. If the project uses Pytest, as many do, we
often have to be explicit in the build either by adding #:test-target
"pytest" to the arguments and python-pytest-runner to native-inputs, or
by replacing the check phase and invoking pytest manually. Since
pytest-runner was deprecated recently, I believe the latter is the
better option from now on. The build could succeed without being
explicit, but you will see a message like "0 tests ran succesfully".
That may have happened in patches 2 and 5 from the series.

> +    (home-page
> +      "https://github.com/vxgmichel/aiostream")
> +    (synopsis
> +      "Generator-based operators for asynchronous iteration")

We don't break lines for the arguments of home-page and synopsis. The
pypi importer will add them by default, but they should be removed
while editing.

In the description, I'd replace "aiostream" with "@code{aiostream}".

The LICENSE file states GPL 3, though there are no copyright headers to
say "any later version". setup.py also says "gplv3". I'm guessing the
license should be gpl3 only, though I'm not sure about that one.

LGTM otherwise.

Could you check the rest of the series to see if the tests are running
correctly and then send a v2? I am not a committer and can't apply it
myself, so I have to leave that part for somebody else.

Vinicius
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 98368129ed..8e769c08f2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20187,6 +20187,36 @@  generators and Python 3.7's context managers into Python 3.5.")
 manager compatible with @code{asyncio}.")
     (license license:asl2.0)))
 
+(define-public python-aiostream
+  (package
+    (name "python-aiostream")
+    (version "0.4.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "aiostream" version))
+        (sha256
+          (base32
+            "1k33bxrp24pa7c3hygzkv0lqvjil689aj442hzhgzv8vsbqmwd1n"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f)) ; tests fail, not sure why
+    ;; (native-inputs
+    ;;  `(("python-pytest" ,python-pytest)
+    ;;    ("python-pytest-asyncio" ,python-pytest-asyncio)
+    ;;    ("python-pytest-cov" ,python-pytest-cov)
+    ;;    ("python-pytest-runner" ,python-pytest-runner)))
+    (home-page
+      "https://github.com/vxgmichel/aiostream")
+    (synopsis
+      "Generator-based operators for asynchronous iteration")
+    (description
+      "aiostream provides a collection of stream operators that can be
+combined to create asynchronous pipelines of operations.  It can be seen as an
+asynchronous version of itertools, although some aspects are slightly
+different.")
+    (license license:gpl3+)))
+
 (define-public python-glob2
   (package
     (name "python-glob2")