summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/volvooncall/default.nix
blob: ac459dd7aaa1291d99c91ac0e697d568ce6505ca (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  lib,
  aiohttp,
  amqtt,
  buildPythonPackage,
  certifi,
  docopt,
  fetchFromGitHub,
  fetchpatch,
  geopy,
  mock,
  pytest-asyncio_0,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "volvooncall";
  version = "0.10.4";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "molobrakos";
    repo = "volvooncall";
    tag = "v${version}";
    hash = "sha256-xr3g93rt3jvxVZrZY7cFh5eBP3k0arsejsgvx8p5EV4=";
  };

  patches = [
    # Remove asynctest, https://github.com/molobrakos/volvooncall/pull/92
    (fetchpatch {
      name = "remove-asnyc.patch";
      url = "https://github.com/molobrakos/volvooncall/commit/ef0df403250288c00ed4c600e9dfa79dcba8941e.patch";
      hash = "sha256-U+hM7vzD9JSEUumvjPSLpVQcc8jAuZHG3/1dQ3wnIcA=";
    })
  ];

  propagatedBuildInputs = [ aiohttp ];

  optional-dependencies = {
    console = [
      certifi
      docopt
      geopy
    ];
    mqtt = [
      amqtt
      certifi
    ];
  };

  checkInputs = [
    mock
    pytest-asyncio_0
    pytestCheckHook
  ]
  ++ optional-dependencies.mqtt;

  pythonImportsCheck = [ "volvooncall" ];

  meta = {
    description = "Retrieve information from the Volvo On Call web service";
    homepage = "https://github.com/molobrakos/volvooncall";
    changelog = "https://github.com/molobrakos/volvooncall/releases/tag/v${version}";
    license = lib.licenses.unlicense;
    mainProgram = "voc";
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}