summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyeapi/default.nix
blob: b33e4d7035e5e4d191b9345c7e8b3d24a872bbe1 (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
64
65
66
67
68
69
70
71
72
73
74
75
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, setuptools
, mock
, netaddr
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pyeapi";
  version = "0.8.4";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "arista-eosplus";
    repo = pname;
    rev = "v${version}";
    sha256 = "13chya6wix5jb82k67gr44bjx35gcdwz80nsvpv0gvzs6shn4d7b";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    netaddr
  ];

  nativeCheckInputs = [
    mock
    pytestCheckHook
  ];

  patches = [
    # Fix usage of collection, https://github.com/arista-eosplus/pyeapi/pull/223
    (fetchpatch {
      name = "fix-collection-usage.patch";
      url = "https://github.com/arista-eosplus/pyeapi/commit/81754f57eb095703cc474f527a0915360af76f68.patch";
      sha256 = "sha256-ZNBTPRNmXCFVJeRAJxzIHmCOXZiGwU6t4ekSupU3BX8=";
    })
    (fetchpatch {
      name = "fix-collection-usage-2.patch";
      url = "https://github.com/arista-eosplus/pyeapi/commit/cc9c584e4a3167e3c1624cccb6bc0d9c9bcdbc1c.patch";
      sha256 = "sha256-EY0i1Skm1llEQAAzvrb2yelhhLBkqKAFJB5ObAIxAYo=";
      excludes = [
        ".github/workflows/ci.yml"
      ];
    })
    (fetchpatch {
      name = "fix-collection-usage-3.patch";
      url = "https://github.com/arista-eosplus/pyeapi/commit/dc35ab076687ea71665ae9524480b05a4e893909.patch";
      sha256 = "sha256-xPaYULCPTxiQGB9Im/qLet+XebW9wq+TAfrxcgQxcoE=";
    })
  ];

  pytestFlagsArray = [
    "test/unit"
  ];

  pythonImportsCheck = [
    "pyeapi"
  ];

  meta = with lib; {
    description = "Client for Arista eAPI";
    homepage = "https://github.com/arista-eosplus/pyeapi";
    license = licenses.bsd3;
    maintainers = with maintainers; [ astro ];
  };
}