1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 setuptools,
8}:
9
10buildPythonPackage rec {
11 pname = "batinfo";
12 version = "0.4.2";
13 pyproject = true;
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "nicolargo";
19 repo = "batinfo";
20 tag = "v${version}";
21 hash = "sha256-GgAJJA8bzQJLAU+nxmkDa5LFTHc4NGi+nj9PfKyw8/M=";
22 };
23
24 postPatch = ''
25 substituteInPlace test_batinfo.py \
26 --replace-fail "self.assertEquals" "self.assertEqual"
27 '';
28
29 build-system = [ setuptools ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 pythonImportsCheck = [ "batinfo" ];
34
35 disabledTests = [
36 # Tests are a bit outdated
37 "test_batinfo_capacity"
38 "test_batinfo_charge_now"
39 "test_batinfo_name_default"
40 ];
41
42 meta = with lib; {
43 description = "Module to retrieve battery information";
44 homepage = "https://github.com/nicolargo/batinfo";
45 license = licenses.lgpl3Plus;
46 maintainers = with maintainers; [ koral ];
47 platforms = platforms.linux;
48 };
49}