<commit_before>{ lib
, buildPythonPackage
, fetchPypi
, six
}:

buildPythonPackage rec {
  pname = "headerparser";
  version = "0.4.0";

  src = fetchPypi{
    inherit pname;
    inherit version;
    sha256 = "b8ceae4c5e6133fda666d022684e93f9b3d45815c2c7881018123c71ff28c5cc";
  };

  buildInputs = [
    six
  ];

  meta = with lib; {
    homepage = "https://github.com/jwodder/headerparser";
    description = "argparse for mail-style headers";
    license = with licenses; [ mit ];
    maintainers = with lib.maintainers; [ ayazhafiz ];
  };
}<commit_msg>python310Packages.headerparser: enable tests<commit_after>{ lib
, buildPythonPackage
, fetchFromGitHub
, pytest-mock
, pytestCheckHook
, pythonOlder
, six
}:

buildPythonPackage rec {
  pname = "headerparser";
  version = "0.4.0";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "jwodder";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-KJJt85iC/4oBoIelB2zUJVyHSppFem/22v6F30P5nYM=";
  };

  propagatedBuildInputs = [
    six
  ];

  checkInputs = [
    pytest-mock
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace tox.ini \
      --replace "--cov=headerparser" "" \
      --replace "--no-cov-on-fail" "" \
      --replace "--flakes" ""
  '';

  pythonImportsCheck = [
    "headerparser"
  ];

  meta = with lib; {
    description = "Module to parse key-value pairs in the style of RFC 822 (e-mail) headers";
    homepage = "https://github.com/jwodder/headerparser";
    license = with licenses; [ mit ];
    maintainers = with maintainers; [ ayazhafiz ];
  };
}
{'fraction_non_alphanumeric': 0.13320825515947468, 'fraction_numerical': 0.04440275171982489, 'mean_word_length': 3.0816326530612246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4260991', 'n_tokens_mistral': 631, 'n_tokens_neox': 585, 'n_words': 113}