From 6fb86132867e7d15ddaba707e54bded9127a525d Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 8 Dec 2024 12:23:21 +0000 Subject: gnu: python-asyncssh: Improve package style. * gnu/packages/ssh.scm: Add pyproject-build-system. (python-asyncssh): Use G-expressions and new package style. [build-system]: Swap to pyrpoject-build-system. [arguments]: Move skip test logic here. : Remove 'disable-tests, add 'pre-check. [native-inputs]: Apply list style and sort alphabetically. Add python-setuptools, and python-wheel. [propagated-inputs]: Apply list style and sort alphabetically. Change-Id: I021361c3667f60b60fc137380800646f10f2cd05 --- gnu/packages/ssh.scm | 69 +++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 33 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index a44976b598..e835200ab9 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2023 Simon Streit ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2024 Ashish SHUKLA +;;; Copyright © 2024 Sharlatan Hellseher ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,6 +78,7 @@ #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system python) + #:use-module (guix build-system pyproject) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix gexp) @@ -812,40 +814,41 @@ shell services and remote host selection.") (method url-fetch) (uri (pypi-uri "asyncssh" version)) (sha256 - (base32 - "11zq9ywzgyljzihdygawzad0ydly0l32zvz11liwyi8bbk087fzb")))) - (build-system python-build-system) - (propagated-inputs - (list python-cryptography python-pyopenssl python-gssapi - python-bcrypt python-typing-extensions)) - (native-inputs - (list openssh openssl python-fido2 python-aiofiles netcat - python-pytest)) + (base32 "11zq9ywzgyljzihdygawzad0ydly0l32zvz11liwyi8bbk087fzb")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'disable-tests - (lambda* _ - (substitute* "tests/test_connection.py" - ;; nc is always available. - (("which nc") "true")) - (substitute* "tests/test_agent.py" - ;; TODO 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"))) - (substitute* "tests/test_connection.py" - ;; Tests fail with: asyncssh.misc.ConnectionLost: Connection lost - (("(.+)async def test_get_server_host_key_proxy" all indent) - (string-append indent "@unittest.skip('disabled by guix')\n" - indent "async def test_get_server_host_key_proxy")) - (("(.+)async def test_connect_reverse_proxy" all indent) - (string-append indent "@unittest.skip('disabled by guix')\n" - indent "async def test_connect_reverse_proxy"))))) - (replace 'check - (lambda* (#:key tests? inputs outputs #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv"))))))) + (list + #:test-flags + #~(list "-k" (string-join + ;; TODO Test fails for unknown reason + (list "not test_confirm" + ;; Tests fail with: asyncssh.misc.ConnectionLost: + ;; Connection lost + "test_get_server_host_key_proxy" + "test_connect_reverse_proxy") + " and not " )) + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda* _ + (substitute* "tests/test_connection.py" + ;; nc is always available. + (("which nc") "true"))))))) + (native-inputs + (list netcat + openssh + openssl + python-aiofiles + python-fido2 + python-pytest + python-setuptools + python-wheel)) + (propagated-inputs + (list python-cryptography + python-pyopenssl + python-gssapi + python-bcrypt + python-typing-extensions)) (home-page "https://asyncssh.readthedocs.io/") (synopsis "Asynchronous SSHv2 client and server library for Python") (description -- cgit v1.2.3