1{
2 lib,
3 aiohttp,
4 async-timeout,
5 buildPythonPackage,
6 crcmod,
7 defusedxml,
8 fetchFromGitHub,
9 freezegun,
10 jsonpickle,
11 munch,
12 pyserial,
13 pytest-aiohttp,
14 pytest-asyncio,
15 pytestCheckHook,
16 python-dateutil,
17 pythonOlder,
18 semver,
19 setuptools,
20 wheel,
21}:
22
23buildPythonPackage rec {
24 pname = "plugwise";
25 version = "0.38.3";
26 pyproject = true;
27
28 disabled = pythonOlder "3.11";
29
30 src = fetchFromGitHub {
31 owner = "plugwise";
32 repo = "python-plugwise";
33 rev = "refs/tags/v${version}";
34 hash = "sha256-DFHKycFWtR8moLyGaiDVqnrlg+ydgR8/UVgkUpzqAuY=";
35 };
36
37 postPatch = ''
38 # setuptools
39 sed -i -e "s/~=[0-9.]*//" pyproject.toml
40 # wheel
41 sed -i -e "s/~=[0-9.]*//" pyproject.toml
42 '';
43
44 build-system = [
45 setuptools
46 wheel
47 ];
48
49 dependencies = [
50 aiohttp
51 async-timeout
52 crcmod
53 defusedxml
54 munch
55 pyserial
56 python-dateutil
57 semver
58 ];
59
60 nativeCheckInputs = [
61 freezegun
62 jsonpickle
63 pytest-aiohttp
64 pytest-asyncio
65 pytestCheckHook
66 ];
67
68 pythonImportsCheck = [ "plugwise" ];
69
70 __darwinAllowLocalNetworking = true;
71
72 meta = with lib; {
73 description = "Python module for Plugwise Smiles, Stretch and USB stick";
74 homepage = "https://github.com/plugwise/python-plugwise";
75 changelog = "https://github.com/plugwise/python-plugwise/releases/tag/v${version}";
76 license = with licenses; [ mit ];
77 maintainers = with maintainers; [ fab ];
78 };
79}