1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 httpx,
6 poetry-core,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10 respx,
11}:
12
13buildPythonPackage rec {
14 pname = "pyecoforest";
15 version = "0.4.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "pjanuario";
22 repo = "pyecoforest";
23 tag = "v${version}";
24 hash = "sha256-C8sFq0vsVsq6irWbRd0eq18tfKu0qRRBZHt23CiDTGU=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace-fail "--cov=pyecoforest --cov-report=term-missing:skip-covered" ""
30 '';
31
32 build-system = [ poetry-core ];
33
34 dependencies = [ httpx ];
35
36 nativeCheckInputs = [
37 pytest-asyncio
38 pytestCheckHook
39 respx
40 ];
41
42 disabledTests = [
43 # respx.models.AllMockedAssertionError
44 "test_get"
45 "test_get_errors"
46 "test_set_temperature"
47 "test_set_power"
48 "test_turn"
49 ];
50
51 pythonImportsCheck = [ "pyecoforest" ];
52
53 meta = with lib; {
54 description = "Module for interacting with Ecoforest devices";
55 homepage = "https://github.com/pjanuario/pyecoforest";
56 changelog = "https://github.com/pjanuario/pyecoforest/blob/${version}/CHANGELOG.md";
57 license = licenses.mit;
58 maintainers = with maintainers; [ fab ];
59 };
60}