1{
2 argon2-cffi,
3 bcrypt,
4 buildPythonPackage,
5 cryptography,
6 fetchFromGitHub,
7 hatchling,
8 lib,
9 pytest-archon,
10 pytest-xdist,
11 pytestCheckHook,
12 typing-extensions,
13}:
14
15buildPythonPackage rec {
16 pname = "libpass";
17 version = "1.9.1.post0";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "ThirVondukr";
22 repo = "passlib";
23 tag = version;
24 hash = "sha256-4J18UktqllRA8DVdHL4AJUuAkjZRdUjiql9a71XXhCA=";
25 };
26
27 build-system = [ hatchling ];
28
29 optional-dependencies = {
30 argon2 = [ argon2-cffi ];
31 bcrypt = [ bcrypt ];
32 totp = [ cryptography ];
33 };
34
35 nativeCheckInputs = [
36 pytest-archon
37 pytest-xdist
38 pytestCheckHook
39 ]
40 ++ lib.flatten (lib.attrValues optional-dependencies);
41
42 pythonImportsCheck = [ "passlib" ];
43
44 disabledTests = [
45 # timming sensitive
46 "test_dummy_verify"
47 "test_encrypt_cost_timing"
48 ];
49
50 meta = {
51 changelog = "https://github.com/ThirVondukr/passlib/blob/${src.tag}/CHANGELOG.md";
52 description = "Comprehensive password hashing framework supporting over 30 schemes";
53 homepage = "https://github.com/ThirVondukr/passlib";
54 license = lib.licenses.bsd3;
55 maintainers = with lib.maintainers; [ dotlambda ];
56 };
57}