about summary refs log tree commit diff
path: root/pkgs/development/python-modules/amcrest/default.nix
blob: 0a217c6f7832b2a28f034adc953f697576a75a89 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  lib,
  argcomplete,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch2,
  httpx,
  mock,
  pytestCheckHook,
  requests,
  responses,
  setuptools,
  typing-extensions,
  urllib3,
}:

buildPythonPackage rec {
  pname = "amcrest";
  version = "1.9.8";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "tchellomello";
    repo = "python-amcrest";
    rev = "refs/tags/${version}";
    hash = "sha256-v0jWEZo06vltEq//suGrvJ/AeeDxUG5CCFhbf03q34w=";
  };

  patches = [
    (fetchpatch2 {
      # https://github.com/tchellomello/python-amcrest/pull/235
      name = "replace-distutils.patch";
      url = "https://github.com/tchellomello/python-amcrest/commit/ec56049c0f5b49bc4c5bcf0acb7fea89ec1c1df4.patch";
      hash = "sha256-ym+Bn795y+JqhNMk4NPnOVr3DwO9DkUV0d9LEaz3CMo=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [
    argcomplete
    httpx
    requests
    urllib3
    typing-extensions
  ];

  nativeCheckInputs = [
    mock
    pytestCheckHook
    responses
  ];

  pythonImportsCheck = [ "amcrest" ];

  meta = with lib; {
    description = "Python module for Amcrest and Dahua Cameras";
    homepage = "https://github.com/tchellomello/python-amcrest";
    changelog = "https://github.com/tchellomello/python-amcrest/releases/tag/${version}";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ fab ];
  };
}