diff mbox series

[bug#41807,PATCHES] Add python-sanic and dependencies.

Message ID 20201113085914.GC3133@zpidnp36
State Accepted
Headers show
Series [bug#41807,PATCHES] Add python-sanic and dependencies. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Lars-Dominik Braun Nov. 13, 2020, 8:59 a.m. UTC
Hi,

> I managed to package sanic following your channel definition (and enabled
> tests), I updated some packages, removed some other packages that were
> already merged in Guix and produced an updated patch set.
I’ve tested the patches with a real application and made some minor
modifications pointed out by `guix lint`. Also python-sanic requests
multidict==5.0.0, which we don’t have right now. But it seems to work with
4.7.5 just fine.

Cheers,
Lars

Comments

paul Nov. 30, 2020, 11:25 p.m. UTC | #1
Dear Lars,

Thank you for your extensive review and your time. Should I send an 
update patch set or are you going to push the patches with your fixes?

Cheers,

Giacomo
Lars-Dominik Braun Dec. 1, 2020, 7:16 a.m. UTC | #2
Hi,

> Thank you for your extensive review and your time. Should I send an update
> patch set or are you going to push the patches with your fixes?
actually I’m just a normal contributor like you without commit access. We’ll
have to wait for a maintainer to pick it up.

Cheers,
Lars
Leo Famulari Dec. 15, 2020, 7:04 a.m. UTC | #3
On Fri, Nov 13, 2020 at 09:59:14AM +0100, Lars-Dominik Braun wrote:
> Hi,
> 
> > I managed to package sanic following your channel definition (and enabled
> > tests), I updated some packages, removed some other packages that were
> > already merged in Guix and produced an updated patch set.
> I’ve tested the patches with a real application and made some minor
> modifications pointed out by `guix lint`. Also python-sanic requests
> multidict==5.0.0, which we don’t have right now. But it seems to work with
> 4.7.5 just fine.

Thanks for the patches Giacomo and Lars-Dominik!

Pushed as e779dc8be048a85fa0e51013b1aed46082284937

`guix lint` reported that a few packages have newer versions available.
Can you take a look?
Lars-Dominik Braun Dec. 15, 2020, 8:56 a.m. UTC | #4
Hi Leo,

> Thanks for the patches Giacomo and Lars-Dominik!
> 
> Pushed as e779dc8be048a85fa0e51013b1aed46082284937
> 
> `guix lint` reported that a few packages have newer versions available.
> Can you take a look?
python-mypy-extensions already exists in python-check.scm and is causing a
conflict now.

Cheers,
Lars
Leo Famulari Dec. 15, 2020, 7:23 p.m. UTC | #5
On Tue, Dec 15, 2020 at 09:56:29AM +0100, Lars-Dominik Braun wrote:
> python-mypy-extensions already exists in python-check.scm and is causing a
> conflict now.

Can you clarify what sort of conflict you are describing? I noticed that
we already have a python-mypy-extensions package, and so I omitted the
one from this patch series.
Lars-Dominik Braun Dec. 16, 2020, 7:15 a.m. UTC | #6
Hi Leo,

> > python-mypy-extensions already exists in python-check.scm and is causing a
> > conflict now.
> 
> Can you clarify what sort of conflict you are describing? I noticed that
> we already have a python-mypy-extensions package, and so I omitted the
> one from this patch series.
sorry, my bad. Looks like `git worktree add` served me my own old sanic branch
instead of forking master.

Cheers,
Lars
diff mbox series

Patch

From 34bba96451cb29cb38706d04f7703301b1ae7dd7 Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Fri, 13 Nov 2020 09:55:19 +0100
Subject: [PATCH 10/10] gnu: Add python-sanic.

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

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 37c5980dc2..958cbd5323 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -39,6 +39,7 @@ 
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5215,3 +5216,62 @@  over IMAP:
      "@code{python-hstspreload} contains Chromium HSTS Preload list
 as a Python package.")
     (license license:bsd-3)))
+
+(define-public python-sanic
+  (package
+    (name "python-sanic")
+    (version "20.9.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "sanic" version))
+       (sha256
+        (base32
+         "06p0lsxqbfbka2yaqlpp0bg5pf7ma44zi6kq7qbb6hhry48dp1w6"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'use-recent-pytest
+           ;; Allow using recent dependencies.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "setup.py"
+               (("httpcore==0.3.0") "httpcore")
+               (("pytest==5.2.1") "pytest")
+               (("multidict==5.0.0") "multidict"))
+             #t))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "-vv" "./tests" "-k"
+                     "not test_zero_downtime and not test_gunicorn_worker"))))))
+    (propagated-inputs
+     `(("python-aiofiles" ,python-aiofiles)
+       ("python-httptools" ,python-httptools)
+       ("python-httpx" ,python-httpx)
+       ("python-multidict" ,python-multidict)
+       ("python-ujson" ,python-ujson)
+       ("python-uvloop" ,python-uvloop)
+       ("python-websockets" ,python-websockets)))
+    (native-inputs
+     `(("gunicorn" ,gunicorn)
+       ("python-beautifulsoup4" ,python-beautifulsoup4)
+       ("python-hstspreload" ,python-hstspreload)
+       ("python-httpcore" ,python-httpcore)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-benchmark" ,python-pytest-benchmark)
+       ("python-pytest-sanic" ,python-pytest-sanic)
+       ("python-pytest-sugar" ,python-pytest-sugar)
+       ("python-urllib3" ,python-urllib3)
+       ("python-uvicorn" ,python-uvicorn)))
+    (home-page
+     "https://github.com/huge-success/sanic/")
+    (synopsis
+     "Async Python 3.6+ web server/framework")
+    (description
+     "Sanic is a Python 3.6+ web server and web framework
+that's written to go fast.  It allows the usage of the
+@code{async/await} syntax added in Python 3.5, which makes
+your code non-blocking and speedy.")
+    (license license:expat)))
-- 
2.26.2