1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 netifaces,
7 paho-mqtt,
8 pycryptodome,
9 requests,
10 six,
11 zeroconf,
12}:
13
14buildPythonPackage rec {
15 pname = "libpurecool";
16 version = "0.6.4";
17 pyproject = true;
18
19 src = fetchPypi {
20 inherit pname version;
21 sha256 = "1kwbinbg0i4fca1bpx6jwa1fiw71vg0xa89jhq4pmnl5cn9c8kqx";
22 };
23
24 # Remove vendorized zeroconf, https://github.com/etheralm/libpurecool/issues/33
25 postPatch = ''
26 rm libpurecool/zeroconf.py
27 substituteInPlace libpurecool/dyson_pure_cool_link.py \
28 --replace-fail "from .zeroconf import ServiceBrowser, Zeroconf" "from zeroconf import ServiceBrowser, Zeroconf"
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 netifaces
35 paho-mqtt
36 pycryptodome
37 requests
38 six
39 zeroconf
40 ];
41
42 # Tests are only present in repo, https://github.com/etheralm/libpurecool/issues/36
43 doCheck = false;
44 pythonImportsCheck = [ "libpurecool" ];
45
46 meta = with lib; {
47 description = "Python library for Dyson devices";
48 homepage = "http://libpurecool.readthedocs.io";
49 license = with licenses; [ asl20 ];
50 maintainers = with maintainers; [ fab ];
51 };
52}