diff mbox series

[bug#60838,v2,5/7] gnu: Add python-asgi-lifespan.

Message ID c020eb5bb722890dacc3c27bf4b9f388434352ab.1679080713.git.felgru@posteo.net
State New
Headers show
Series Add datasette and python-sqlite-utils. | expand

Commit Message

Felix Gruber March 17, 2023, 7:19 p.m. UTC
* gnu/packages/python-web.scm (python-asgi-lifespan): New variable.
---
 gnu/packages/python-web.scm | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

Comments

Maxim Cournoyer March 22, 2023, 1:17 a.m. UTC | #1
Hi,

Felix Gruber <felgru@posteo.net> writes:

> * gnu/packages/python-web.scm (python-asgi-lifespan): New variable.
> ---
>  gnu/packages/python-web.scm | 25 ++++++++++++++++++++++++-
>  1 file changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
> index 8a73c929a1..83e7d77da8 100644
> --- a/gnu/packages/python-web.scm
> +++ b/gnu/packages/python-web.scm
> @@ -49,7 +49,7 @@
>  ;;; Copyright © 2021 Alice Brenon <alice.brenon@ens-lyon.fr>
>  ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
>  ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
> -;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
> +;;; Copyright © 2022, 2023 Felix Gruber <felgru@posteo.net>
>  ;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
>  ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
>  ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
> @@ -570,6 +570,29 @@ (define-public python-asgiref
>  WSGI.  This package includes libraries for implementing ASGI servers.")
>      (license license:bsd-3)))
>  
> +(define-public python-asgi-lifespan
> +  (package
> +    (name "python-asgi-lifespan")
> +    (version "1.0.1")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (pypi-uri "asgi-lifespan" version))
> +              (sha256
> +               (base32
> +                "0zyvx8i43s1m2akqn5njwdh2zi6n05ji7mlvqx5pdi3k43dffcws"))))
> +    (build-system python-build-system)

To run pytest tests without having to override the check suite, you'll
want to use the pyproject-build-system.

> +    (arguments
> +     '(#:tests? #f)) ; The pypi package does not contain the tests folder.

Please fetch from git to run the test suite.  I typically leave a
comment ";for tests" to the right of the (method git-fetch) line, to
explain why we deviate from the source archives.

> +    (native-inputs (list python-pytest python-pytest-asyncio python-pytest-cov))
> +    (propagated-inputs (list python-sniffio))
> +    (home-page "https://github.com/florimondmanca/asgi-lifespan")
> +    (synopsis "Programmatic startup/shutdown of ASGI apps")
> +    (description "Programmatically send startup/shutdown lifespan events
> +into ASGI applications.  When used in combination with an ASGI-capable
> +HTTP client such as HTTPX, this allows mocking or testing ASGI
> +applications without having to spin up an ASGI server.")
> +    (license license:expat)))

Please define the lesser known acronyms in the description, using for
example like in "into Asynchronous Server Gateway Interface (ASGI)
applications." or the Texinfo @acronym command.
diff mbox series

Patch

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 8a73c929a1..83e7d77da8 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -49,7 +49,7 @@ 
 ;;; Copyright © 2021 Alice Brenon <alice.brenon@ens-lyon.fr>
 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2022, 2023 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
@@ -570,6 +570,29 @@  (define-public python-asgiref
 WSGI.  This package includes libraries for implementing ASGI servers.")
     (license license:bsd-3)))
 
+(define-public python-asgi-lifespan
+  (package
+    (name "python-asgi-lifespan")
+    (version "1.0.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "asgi-lifespan" version))
+              (sha256
+               (base32
+                "0zyvx8i43s1m2akqn5njwdh2zi6n05ji7mlvqx5pdi3k43dffcws"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; The pypi package does not contain the tests folder.
+    (native-inputs (list python-pytest python-pytest-asyncio python-pytest-cov))
+    (propagated-inputs (list python-sniffio))
+    (home-page "https://github.com/florimondmanca/asgi-lifespan")
+    (synopsis "Programmatic startup/shutdown of ASGI apps")
+    (description "Programmatically send startup/shutdown lifespan events
+into ASGI applications.  When used in combination with an ASGI-capable
+HTTP client such as HTTPX, this allows mocking or testing ASGI
+applications without having to spin up an ASGI server.")
+    (license license:expat)))
+
 (define-public python-css-html-js-minify
   (package
     (name "python-css-html-js-minify")