summary refs log tree commit diff
path: root/pkgs/development/python-modules/qnapstats/default.nix
blob: 1803d2ffe72ebde71f28da9999b92c12bf4f78f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, buildPythonPackage
, fetchFromGitHub
, requests
, xmltodict
, responses
, python
}:

buildPythonPackage rec {
  pname = "qnapstats";
  version = "0.5.0";

  format = "setuptools";

  src = fetchFromGitHub {
    owner = "colinodell";
    repo = "python-qnapstats";
    rev = "refs/tags/${version}";
    hash = "sha256-dpxl6a61h8zB7eS/2lxG+2//bOTzV6s4T1W+DVj0fnI=";
  };

  propagatedBuildInputs = [
    requests
    xmltodict
  ];

  checkInputs = [
    responses
  ];

  checkPhase = ''
    runHook preCheck

    ${python.interpreter} tests/test-models.py

    runHook postCheck
  '';

  pythonImportsCheck = [ "qnapstats" ];

  meta = {
    description = "Python API for obtaining QNAP NAS system stats";
    homepage = "https://github.com/colinodell/python-qnapstats";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}