1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 fetchpatch, 6 7 # propagates 8 cryptography, 9 six, 10 11 # optional 12 webob, 13 14 # tests 15 pytestCheckHook, 16}: 17 18buildPythonPackage rec { 19 pname = "python-u2flib-server"; 20 version = "5.0.1"; 21 format = "setuptools"; 22 23 src = fetchFromGitHub { 24 owner = "Yubico"; 25 repo = "python-u2flib-server"; 26 rev = version; 27 hash = "sha256-ginP9u+aHcdaWpwcFYJWu0Ghf7+nDZq9i3TVAacIPhg="; 28 }; 29 30 patches = [ ./cryptography-37-compat.patch ]; 31 32 propagatedBuildInputs = [ 33 cryptography 34 six 35 ]; 36 37 passthru.optional-dependencies = { 38 u2f_server = [ webob ]; 39 }; 40 41 pythonImportsCheck = [ 42 "u2flib_server" 43 "u2flib_server.u2f" 44 ]; 45 46 nativeCheckInputs = [ pytestCheckHook ] ++ passthru.optional-dependencies.u2f_server; 47 48 meta = with lib; { 49 description = "Python based U2F server library"; 50 homepage = "https://github.com/Yubico/python-u2flib-server"; 51 changelog = "https://github.com/Yubico/python-u2flib-server/blob/${src.rev}/NEWS"; 52 license = licenses.bsd2; 53 maintainers = with maintainers; [ hexa ]; 54 }; 55}