1{ lib
2, buildPythonPackage
3, click
4, defusedxml
5, fetchFromGitHub
6, httpx
7, poetry-core
8, pydantic
9, pytest-asyncio
10, pytestCheckHook
11, pythonOlder
12, respx
13}:
14
15buildPythonPackage rec {
16 pname = "sfrbox-api";
17 version = "0.0.6";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "hacf-fr";
24 repo = pname;
25 rev = "refs/tags/v${version}";
26 hash = "sha256-1Jn785e4aLd83EHjkgB90sWi9No8wqCjUEn4ecyVl4o=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace 'pydantic = ">=1.10.2"' 'pydantic = "*"'
32 '';
33
34 nativeBuildInputs = [
35 poetry-core
36 ];
37
38 propagatedBuildInputs = [
39 click
40 defusedxml
41 httpx
42 pydantic
43 ];
44
45 nativeCheckInputs = [
46 pytest-asyncio
47 pytestCheckHook
48 respx
49 ];
50
51 pythonImportsCheck = [
52 "sfrbox_api"
53 ];
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/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}