Subject: Re: [PATCH] gnu: Add python-asyncssh

From: Lars-Dominik Braun <[email-masked]>
Date: Mon, 27 Jul 2020 10:38:23 +0200

Hi again,

since master now has python-cryptography==2.9, we can safely add
python-asyncssh without any custom patches. The attached patches first update
python-gssapi (a dependency) and then add python-asyncssh.

Cheers,
Lars

From 5701cf477487e5e43153f6d889869a33addae5e2 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Mon, 27 Jul 2020 10:32:24 +0200
Subject: [PATCH 1/2] gnu: python-gssapi: Update to 1.6.9.

* gnu/packages/python-xyz.scm (python-gssapi)[version]: Update to 1.6.9.
[arguments]: Disable failing tests.
---
 gnu/packages/python-xyz.scm | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3aebff078b..490d35f197 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19611,15 +19611,35 @@ tests.")
 (define-public python-gssapi
   (package
     (name "python-gssapi")
-    (version "1.6.5")
+    (version "1.6.9")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "gssapi" version))
        (sha256
         (base32
-         "02i5s7998dg5kcr4m0xwamd8vjqk1816xbzldyp68l91f6bynwcr"))))
+         "1fa78pn5jzfbwf3y6mj4fc8sh11wjf1hwh5qv39cdlxb71qsq2hb"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-tests
+           (lambda* _
+             ;; XXX: These test fails for unknown reasons.
+             (substitute* "gssapi/tests/test_raw.py"
+               (("(.+)def (test_acquire_creds_impersonate_name)" all indent
+                 fname)
+                (string-append indent "@unittest.skip('disabled by guix')\n"
+                 indent "def " fname))
+               (("(.+)def (test_add_cred_impersonate_name)" all indent fname)
+                (string-append indent "@unittest.skip('disabled by guix')\n"
+                 indent "def " fname)))
+             (substitute* "gssapi/tests/test_high_level.py"
+               (("import copy" all)
+                (string-append all "\nimport unittest"))
+               (("(.+)def (test_add_with_impersonate)" all indent fname)
+                (string-append indent "@unittest.skip('disabled by guix')\n"
+                 indent "def " fname))))))))
     (propagated-inputs
      `(("python-decorator" ,python-decorator)
        ("python-six" ,python-six)))
-- 
2.20.1

From 7e30a2e8d122daf5f7e7ba6eee92a69f3ed4f49f Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <[email-masked]>
Date: Tue, 28 Apr 2020 11:41:08 +0200
Subject: [PATCH 2/2] gnu: Add python-asyncssh.

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 490d35f197..f2d158773e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -21059,3 +21059,43 @@ and have a maximum lifetime built-in.")
      "This package contains a small collection of test tool plugins for
 @code{nose2} and @code{flake8}.")
     (license license:asl2.0)))
+
+(define-public python-asyncssh
+  (package
+    (name "python-asyncssh")
+    (version "2.3.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "asyncssh" version))
+        (sha256
+          (base32
+            "0pi6npmsgx7l9r1qrfvg8mxx3i23ipff492xz4yhrw13f56a7ga4"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-cryptography" ,python-cryptography)
+       ("python-pyopenssl" ,python-pyopenssl)
+       ("python-gssapi" ,python-gssapi)
+       ("python-bcrypt" ,python-bcrypt)))
+    ;; required for test suite
+    (native-inputs
+     `(("openssh" ,openssh)
+       ("openssl" ,openssl)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'disable-tests
+           (lambda* _
+            (substitute* "tests/test_agent.py"
+              ;; Test fails for unknown reason
+              (("(.+)async def test_confirm" all indent)
+                (string-append indent "@unittest.skip('disabled by guix')\n"
+                 indent "async def test_confirm"))))))))
+    (home-page "https://asyncssh.readthedocs.io/")
+    (synopsis
+      "Asynchronous SSHv2 client and server library")
+    (description
+      "AsyncSSH is a Python package which provides an asynchronous client and
+server implementation of the SSHv2 protocol on top of the Python 3.6+ asyncio
+framework")
+    (license license:epl2.0)))
-- 
2.20.1