2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2022-05-18 14:49:53 +00:00
|
|
|
, argon2-cffi
|
2020-04-24 23:36:52 +00:00
|
|
|
, bcrypt
|
2022-05-18 14:49:53 +00:00
|
|
|
, cryptography
|
|
|
|
, pytestCheckHook
|
2023-03-27 19:17:25 +00:00
|
|
|
, pythonOlder
|
2023-04-29 16:46:19 +00:00
|
|
|
, pytest-xdist
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "passlib";
|
2020-11-19 00:13:47 +00:00
|
|
|
version = "1.7.4";
|
2023-03-27 19:17:25 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-27 19:17:25 +00:00
|
|
|
hash = "sha256-3v1Q9ytlxUAqssVzgwppeOXyAq0NmEeTyN3ixBUuvgQ";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies = {
|
2022-05-18 14:49:53 +00:00
|
|
|
argon2 = [ argon2-cffi ];
|
|
|
|
bcrypt = [ bcrypt ];
|
|
|
|
totp = [ cryptography ];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
pytestCheckHook
|
2023-04-29 16:46:19 +00:00
|
|
|
pytest-xdist
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ passthru.optional-dependencies.argon2
|
2022-10-30 15:09:59 +00:00
|
|
|
++ passthru.optional-dependencies.bcrypt
|
|
|
|
++ passthru.optional-dependencies.totp;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"passlib"
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabledTests = [
|
|
|
|
# timming sensitive
|
|
|
|
"test_dummy_verify"
|
2022-12-17 10:02:37 +00:00
|
|
|
"test_encrypt_cost_timing"
|
|
|
|
# These tests fail because they don't expect support for algorithms provided through libxcrypt
|
2022-10-30 15:09:59 +00:00
|
|
|
"test_82_crypt_support"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# hashing algorithms we don't support anymore
|
|
|
|
"--deselect=passlib/tests/test_handlers.py::des_crypt_os_crypt_test::test_82_crypt_support"
|
|
|
|
"--deselect=passlib/tests/test_handlers.py::md5_crypt_os_crypt_test::test_82_crypt_support"
|
|
|
|
"--deselect=passlib/tests/test_handlers.py::sha256_crypt_os_crypt_test::test_82_crypt_support"
|
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A password hashing library for Python";
|
2022-03-30 09:31:56 +00:00
|
|
|
homepage = "https://foss.heptapod.net/python-libs/passlib";
|
|
|
|
license = licenses.bsdOriginal;
|
2022-09-30 11:47:45 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|