1{
2 lib,
3 bcrypt,
4 buildPythonPackage,
5 cryptography,
6 fetchPypi,
7 fido2,
8 gssapi,
9 libnacl,
10 libsodium,
11 nettle,
12 openssh,
13 openssl,
14 pyopenssl,
15 pytestCheckHook,
16 python-pkcs11,
17 pythonOlder,
18 setuptools,
19 typing-extensions,
20}:
21
22buildPythonPackage rec {
23 pname = "asyncssh";
24 version = "2.14.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.6";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-6Va/iYjQega6MwX2YE4mH0ygFMSiMvCHPxx2kvvjz8I=";
32 };
33
34 build-system = [ setuptools ];
35
36 dependencies = [
37 cryptography
38 nettle
39 typing-extensions
40 ];
41
42 buildInputs = [ libsodium ];
43
44 optional-dependencies = {
45 bcrypt = [ bcrypt ];
46 fido2 = [ fido2 ];
47 gssapi = [ gssapi ];
48 libnacl = [ libnacl ];
49 pkcs11 = [ python-pkcs11 ];
50 pyOpenSSL = [ pyopenssl ];
51 };
52
53 __darwinAllowLocalNetworking = true;
54
55 nativeCheckInputs = [
56 openssh
57 openssl
58 pytestCheckHook
59 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
60
61 patches = [
62 # Reverts https://github.com/ronf/asyncssh/commit/4b3dec994b3aa821dba4db507030b569c3a32730
63 #
64 # This changed the test to avoid setting the sticky bit
65 # because that's not allowed for plain files in FreeBSD.
66 # However that broke the test on NixOS, failing with
67 # "Operation not permitted"
68 ./fix-sftp-chmod-test-nixos.patch
69 ];
70
71 disabledTestPaths = [
72 # Disables windows specific test (specifically the GSSAPI wrapper for Windows)
73 "tests/sspi_stub.py"
74 ];
75
76 disabledTests = [
77 # No PIN set
78 "TestSKAuthCTAP2"
79 # Requires network access
80 "test_connect_timeout_exceeded"
81 # Fails in the sandbox
82 "test_forward_remote"
83 ];
84
85 pythonImportsCheck = [ "asyncssh" ];
86
87 meta = with lib; {
88 description = "Asynchronous SSHv2 Python client and server library";
89 homepage = "https://asyncssh.readthedocs.io/";
90 changelog = "https://github.com/ronf/asyncssh/blob/v${version}/docs/changes.rst";
91 license = licenses.epl20;
92 maintainers = with maintainers; [ ];
93 };
94}