1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitLab,
6 fetchpatch,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools-scm,
10}:
11
12buildPythonPackage rec {
13 pname = "tololib";
14 version = "1.1.0";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitLab {
20 owner = "MatthiasLohr";
21 repo = "tololib";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-TxWKV2nrnCxZmj6+wBDMSdJRvKV+MsPFbOyIlUJYJ3Q=";
24 };
25
26 build-system = [ setuptools-scm ];
27
28 nativeCheckInputs = [ pytestCheckHook ];
29
30 preCheck = ''
31 export PATH="$PATH:$out/bin";
32 '';
33
34 pythonImportsCheck = [ "tololib" ];
35
36 # Network discovery doesn't work in the sandbox for darwin
37 doCheck = !stdenv.isDarwin;
38
39 meta = with lib; {
40 description = "Python Library for Controlling TOLO Sauna/Steam Bath Devices";
41 homepage = "https://gitlab.com/MatthiasLohr/tololib";
42 changelog = "https://gitlab.com/MatthiasLohr/tololib/-/blob/v${version}/CHANGELOG.md";
43 license = with licenses; [ mit ];
44 maintainers = with maintainers; [ fab ];
45 mainProgram = "tolo-cli";
46 };
47}