1{ lib 2, buildPythonPackage 3, fetchPypi 4, argon2-cffi 5, bcrypt 6, cryptography 7, pytestCheckHook 8, pythonOlder 9, pytest-xdist 10}: 11 12buildPythonPackage rec { 13 pname = "passlib"; 14 version = "1.7.4"; 15 format = "setuptools"; 16 17 disabled = pythonOlder "3.7"; 18 19 src = fetchPypi { 20 inherit pname version; 21 hash = "sha256-3v1Q9ytlxUAqssVzgwppeOXyAq0NmEeTyN3ixBUuvgQ"; 22 }; 23 24 passthru.optional-dependencies = { 25 argon2 = [ argon2-cffi ]; 26 bcrypt = [ bcrypt ]; 27 totp = [ cryptography ]; 28 }; 29 30 nativeCheckInputs = [ 31 pytestCheckHook 32 pytest-xdist 33 ] ++ passthru.optional-dependencies.argon2 34 ++ passthru.optional-dependencies.bcrypt 35 ++ passthru.optional-dependencies.totp; 36 37 pythonImportsCheck = [ 38 "passlib" 39 ]; 40 41 disabledTests = [ 42 # timming sensitive 43 "test_dummy_verify" 44 "test_encrypt_cost_timing" 45 # These tests fail because they don't expect support for algorithms provided through libxcrypt 46 "test_82_crypt_support" 47 ]; 48 49 pytestFlagsArray = [ 50 # hashing algorithms we don't support anymore 51 "--deselect=passlib/tests/test_handlers.py::des_crypt_os_crypt_test::test_82_crypt_support" 52 "--deselect=passlib/tests/test_handlers.py::md5_crypt_os_crypt_test::test_82_crypt_support" 53 "--deselect=passlib/tests/test_handlers.py::sha256_crypt_os_crypt_test::test_82_crypt_support" 54 ]; 55 56 meta = with lib; { 57 description = "A password hashing library for Python"; 58 homepage = "https://foss.heptapod.net/python-libs/passlib"; 59 license = licenses.bsdOriginal; 60 maintainers = with maintainers; [ ]; 61 }; 62}