nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, mock
6, netaddr
7, pytestCheckHook
8, pythonOlder
9}:
10
11buildPythonPackage rec {
12 pname = "pyeapi";
13 version = "0.8.4";
14 format = "pyproject";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "arista-eosplus";
20 repo = pname;
21 rev = "v${version}";
22 sha256 = "13chya6wix5jb82k67gr44bjx35gcdwz80nsvpv0gvzs6shn4d7b";
23 };
24
25 propagatedBuildInputs = [
26 netaddr
27 ];
28
29 checkInputs = [
30 mock
31 pytestCheckHook
32 ];
33
34 patches = [
35 # Fix usage of collection, https://github.com/arista-eosplus/pyeapi/pull/223
36 (fetchpatch {
37 name = "fix-collection-usage.patch";
38 url = "https://github.com/arista-eosplus/pyeapi/commit/81754f57eb095703cc474f527a0915360af76f68.patch";
39 sha256 = "sha256-ZNBTPRNmXCFVJeRAJxzIHmCOXZiGwU6t4ekSupU3BX8=";
40 })
41 (fetchpatch {
42 name = "fix-collection-usage-2.patch";
43 url = "https://github.com/arista-eosplus/pyeapi/commit/cc9c584e4a3167e3c1624cccb6bc0d9c9bcdbc1c.patch";
44 sha256 = "sha256-EY0i1Skm1llEQAAzvrb2yelhhLBkqKAFJB5ObAIxAYo=";
45 excludes = [
46 ".github/workflows/ci.yml"
47 ];
48 })
49 (fetchpatch {
50 name = "fix-collection-usage-3.patch";
51 url = "https://github.com/arista-eosplus/pyeapi/commit/dc35ab076687ea71665ae9524480b05a4e893909.patch";
52 sha256 = "sha256-xPaYULCPTxiQGB9Im/qLet+XebW9wq+TAfrxcgQxcoE=";
53 })
54 ];
55
56 pytestFlagsArray = [
57 "test/unit"
58 ];
59
60 pythonImportsCheck = [
61 "pyeapi"
62 ];
63
64 meta = with lib; {
65 description = "Client for Arista eAPI";
66 homepage = "https://github.com/arista-eosplus/pyeapi";
67 license = licenses.bsd3;
68 maintainers = with maintainers; [ astro ];
69 };
70}