1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build
8 poetry-core,
9
10 # propagates
11 aiohttp,
12 authlib,
13 pydantic,
14 toml,
15
16 # tests
17 pytest-asyncio,
18 pytest-mock,
19 pytestCheckHook,
20}:
21
22let
23 pname = "kanidm";
24 version = "1.0.0-2024-04-22";
25in
26buildPythonPackage rec {
27 inherit pname version;
28 pyproject = true;
29
30 disabled = pythonOlder "3.9";
31
32 src = fetchFromGitHub {
33 owner = "kanidm";
34 repo = "kanidm";
35 rev = "a0f743d8c8e7a6b6b0775e64774fc5175464cab6";
36 hash = "sha256-W2v3/osDrjRQqz2DqoG90SGcu4K6G2ypMTfE6Xq5qNI=";
37 };
38
39 sourceRoot = "${src.name}/pykanidm";
40
41 nativeBuildInputs = [ poetry-core ];
42
43 propagatedBuildInputs = [
44 aiohttp
45 authlib
46 pydantic
47 toml
48 ];
49
50 nativeCheckInputs = [
51 pytest-asyncio
52 pytest-mock
53 pytestCheckHook
54 ];
55
56 pytestFlagsArray = [ "-m 'not network'" ];
57
58 pythonImportsCheck = [ "kanidm" ];
59
60 meta = with lib; {
61 description = "Kanidm client library";
62 homepage = "https://github.com/kanidm/kanidm/tree/master/pykanidm";
63 license = licenses.mpl20;
64 maintainers = with maintainers; [
65 arianvp
66 hexa
67 ];
68 };
69}