mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
Merge pull request #303588 from fabaff/batinfo-refactor
python312Packages.batinfo: refactor
This commit is contained in:
commit
d11b240fa0
@ -1,23 +1,49 @@
|
||||
{ lib, buildPythonPackage, fetchPypi }:
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
setuptools,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "batinfo";
|
||||
version = "0.4.2";
|
||||
format = "setuptools";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "497e29efc9353ec52e71d43bd040bdfb6d685137ddc2b9143cded4583af572f5";
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nicolargo";
|
||||
repo = "batinfo";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-GgAJJA8bzQJLAU+nxmkDa5LFTHc4NGi+nj9PfKyw8/M=";
|
||||
};
|
||||
|
||||
# No tests included
|
||||
doCheck = false;
|
||||
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";
|
||||
description = "A simple Python lib to retrieve battery information";
|
||||
license = licenses.lgpl3;
|
||||
platforms = platforms.linux;
|
||||
license = licenses.lgpl3Plus;
|
||||
maintainers = with maintainers; [ koral ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user