1{ stdenv
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, typing-extensions
19}:
20
21buildPythonPackage rec {
22 pname = "asyncssh";
23 version = "2.12.0";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.6";
27
28 src = fetchPypi {
29 inherit pname version;
30 sha256 = "sha256-J0EBMixLlBgjru2OGrbnvlGRaGxtstK9Na/rowUF54A=";
31 };
32
33 propagatedBuildInputs = [
34 bcrypt
35 cryptography
36 fido2
37 gssapi
38 libnacl
39 libsodium
40 nettle
41 pyopenssl
42 python-pkcs11
43 typing-extensions
44 ];
45
46 checkInputs = [
47 openssh
48 openssl
49 pytestCheckHook
50 ];
51
52 patches = [
53 # Reverts https://github.com/ronf/asyncssh/commit/4b3dec994b3aa821dba4db507030b569c3a32730
54 #
55 # This changed the test to avoid setting the sticky bit
56 # because that's not allowed for plain files in FreeBSD.
57 # However that broke the test on NixOS, failing with
58 # "Operation not permitted"
59 ./fix-sftp-chmod-test-nixos.patch
60 ];
61
62 disabledTestPaths = [
63 # Disables windows specific test (specifically the GSSAPI wrapper for Windows)
64 "tests/sspi_stub.py"
65 ];
66
67 disabledTests = [
68 # No PIN set
69 "TestSKAuthCTAP2"
70 # Requires network access
71 "test_connect_timeout_exceeded"
72 # Fails in the sandbox
73 "test_forward_remote"
74 ];
75
76 pythonImportsCheck = [
77 "asyncssh"
78 ];
79
80 meta = with lib; {
81 broken = stdenv.isDarwin;
82 description = "Asynchronous SSHv2 Python client and server library";
83 homepage = "https://asyncssh.readthedocs.io/";
84 license = licenses.epl20;
85 maintainers = with maintainers; [ ];
86 };
87}