1{
2 lib,
3 buildPythonPackage,
4 click,
5 defusedxml,
6 fetchFromGitHub,
7 httpx,
8 mashumaro,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 respx,
14}:
15
16buildPythonPackage rec {
17 pname = "sfrbox-api";
18 version = "0.0.12";
19 pyproject = true;
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchFromGitHub {
24 owner = "hacf-fr";
25 repo = "sfrbox-api";
26 tag = "v${version}";
27 hash = "sha256-LUQwBzNNuH+hBAGAF7Qcc22I6u53rh+RDRrUuy9xhu8=";
28 };
29
30 pythonRelaxDeps = [
31 "defusedxml"
32 ];
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 defusedxml
38 mashumaro
39 httpx
40 ];
41
42 optional-dependencies = {
43 cli = [ click ];
44 };
45
46 nativeCheckInputs = [
47 pytest-asyncio
48 pytestCheckHook
49 respx
50 ]
51 ++ lib.flatten (builtins.attrValues optional-dependencies);
52
53 pythonImportsCheck = [ "sfrbox_api" ];
54
55 meta = with lib; {
56 description = "Module for the SFR Box API";
57 homepage = "https://github.com/hacf-fr/sfrbox-api";
58 changelog = "https://github.com/hacf-fr/sfrbox-api/releases/tag/${src.tag}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 mainProgram = "sfrbox-api";
62 };
63}