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