depot/third_party/nixpkgs/pkgs/development/python-modules/batinfo/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

49 lines
1 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";
rev = "refs/tags/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 = with lib; {
description = "Module to retrieve battery information";
homepage = "https://github.com/nicolargo/batinfo";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ koral ];
platforms = platforms.linux;
};
}