1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 aiohttp,
7 async-timeout,
8 aioresponses,
9 pytestCheckHook,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "foobot-async";
15 version = "1.0.1";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchPypi {
21 pname = "foobot_async";
22 inherit version;
23 hash = "sha256-QQjysk2m8QkOpLBdC8kfuoA9PcljgEwzKyrIAhxHB4c=";
24 };
25
26 postPatch = ''
27 # https://github.com/reefab/foobot_async/issues/7
28 substituteInPlace foobot_async/__init__.py \
29 --replace-fail "with async_timeout.timeout" "async with async_timeout.timeout"
30 '';
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 aiohttp
36 async-timeout
37 ];
38
39 nativeCheckInputs = [
40 aioresponses
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [ "foobot_async" ];
45
46 meta = with lib; {
47 description = "API Client for Foobot Air Quality Monitoring devices";
48 homepage = "https://github.com/reefab/foobot_async";
49 license = licenses.mit;
50 maintainers = with maintainers; [ dotlambda ];
51 };
52}