Files
nixpkgs/pkgs/development/python-modules/batinfo/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

50 lines
1.0 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
pythonOlder,
setuptools,
}:
buildPythonPackage rec {
pname = "batinfo";
version = "0.4.2";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "nicolargo";
repo = "batinfo";
tag = "v${version}";
hash = "sha256-GgAJJA8bzQJLAU+nxmkDa5LFTHc4NGi+nj9PfKyw8/M=";
};
postPatch = ''
substituteInPlace test_batinfo.py \
--replace-fail "self.assertEquals" "self.assertEqual"
'';
build-system = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "batinfo" ];
disabledTests = [
# Tests are a bit outdated
"test_batinfo_capacity"
"test_batinfo_charge_now"
"test_batinfo_name_default"
];
meta = {
description = "Module to retrieve battery information";
homepage = "https://github.com/nicolargo/batinfo";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [ koral ];
platforms = lib.platforms.linux;
};
}