1{
2 lib,
3 aiodns,
4 aiohttp,
5 async-timeout,
6 attrs,
7 brotlipy,
8 buildPythonPackage,
9 faust-cchardet,
10 click,
11 colorama,
12 fetchFromGitHub,
13 halo,
14 poetry-core,
15 pythonOlder,
16 requests,
17 rich,
18}:
19
20buildPythonPackage rec {
21 pname = "surepy";
22 version = "0.9.0";
23 format = "pyproject";
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchFromGitHub {
28 owner = "benleb";
29 repo = pname;
30 rev = "refs/tags/v${version}";
31 hash = "sha256-ETgpXSUUsV1xoZjdnL2bzn4HwDjKC2t13yXwf28OBqI=";
32 };
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace 'aiohttp = {extras = ["speedups"], version = "^3.7.4"}' 'aiohttp = {extras = ["speedups"], version = ">=3.7.4"}' \
37 --replace 'async-timeout = "^3.0.1"' 'async-timeout = ">=3.0.1"' \
38 --replace 'rich = "^10.1.0"' 'rich = ">=10.1.0"'
39 '';
40
41 nativeBuildInputs = [ poetry-core ];
42
43 propagatedBuildInputs = [
44 aiodns
45 aiohttp
46 async-timeout
47 attrs
48 brotlipy
49 click
50 colorama
51 faust-cchardet
52 halo
53 requests
54 rich
55 ];
56
57 # Project has no tests
58 doCheck = false;
59
60 pythonImportsCheck = [ "surepy" ];
61
62 meta = with lib; {
63 description = "Python library to interact with the Sure Petcare API";
64 mainProgram = "surepy";
65 homepage = "https://github.com/benleb/surepy";
66 license = with licenses; [ mit ];
67 maintainers = with maintainers; [ fab ];
68 };
69}