1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, poetry-core
7, pydantic
8, pytest-aiohttp
9, pytest-asyncio
10, pytestCheckHook
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "aiopurpleair";
16 version = "2022.12.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "bachya";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-YmJH4brWkTpgzyHwu9UnIWrY5qlDCmMtvF+KxQFXwfk=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace 'pydantic = "^1.10.2"' 'pydantic = "*"'
31 '';
32
33 nativeBuildInputs = [
34 poetry-core
35 ];
36
37 propagatedBuildInputs = [
38 aiohttp
39 pydantic
40 ];
41
42 nativeCheckInputs = [
43 aresponses
44 pytest-aiohttp
45 pytest-asyncio
46 pytestCheckHook
47 ];
48
49 disabledTestPaths = [
50 # Ignore the examples directory as the files are prefixed with test_.
51 "examples/"
52 ];
53
54 pythonImportsCheck = [
55 "aiopurpleair"
56 ];
57
58 meta = with lib; {
59 description = "Python library for interacting with the PurpleAir API";
60 homepage = "https://github.com/bachya/aiopurpleair";
61 changelog = "https://github.com/bachya/aiopurpleair/releases/tag/${version}";
62 license = with licenses; [ mit ];
63 maintainers = with maintainers; [ fab ];
64 };
65}