<commit_before>{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, 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";
  };

  propagatedBuildInputs = [
    netaddr
  ];

  checkInputs = [
    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=";
    })
  ];

  postPatch = ''
    # https://github.com/arista-eosplus/pyeapi/pull/223
    substituteInPlace test/unit/test_utils.py \
      --replace "collections.Iterable" "collections.abc.Iterable"
    substituteInPlace pyeapi/api/abstract.py \
      --replace "from collections" "from collections.abc"
  '';

  pytestFlagsArray = [
    "test/unit"
  ];<commit_msg>python310Packages.pyeapi: fix Python 3.10 support<commit_after>{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, 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";
  };

  propagatedBuildInputs = [
    netaddr
  ];

  checkInputs = [
    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 = "<KEY>;
    })
  ];

  pytestFlagsArray = [
    "test/unit"
  ];
{'fraction_non_alphanumeric': 0.12865064695009243, 'fraction_numerical': 0.07800369685767097, 'mean_word_length': 3.2816455696202533, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7552222', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1095, 'n_words': 134}