1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6}:
7
8buildPythonPackage rec {
9 pname = "apcaccess";
10 version = "0.0.13";
11 format = "setuptools";
12
13 src = fetchFromGitHub {
14 owner = "flyte";
15 repo = "apcaccess";
16 rev = version;
17 hash = "sha256-XLoNRh6MgXCfRtWD9NpVZSyroW6E9nRYw6Grxa+AQkc=";
18 };
19
20 postPatch = ''
21 substituteInPlace setup.py \
22 --replace "setup_requires='pytest-runner'," ""
23 '';
24
25 pythonImportsCheck = [ "apcaccess" ];
26
27 nativeCheckInputs = [ pytestCheckHook ];
28
29 meta = with lib; {
30 description = "Library offers programmatic access to the status information provided by apcupsd over its Network Information Server";
31 mainProgram = "apcaccess";
32 homepage = "https://github.com/flyte/apcaccess";
33 license = licenses.mit;
34 maintainers = with maintainers; [ uvnikita ];
35 };
36}