<commit_before>{ stdenv
, buildPythonPackage
, fetchPypi
, pkgs
}:

buildPythonPackage rec {
  pname = "pyenchant";
  version = "1.6.6";

  src = fetchPypi {
    inherit pname version;
    sha256 = "25c9d2667d512f8fc4410465fdd2e868377ca07eb3d56e2b6e534a86281d64d3";
  };

  propagatedBuildInputs = [ pkgs.enchant ];

  patchPhase = let
    path_hack_script = "s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant}/lib/' + e_path)|";
  in ''
    sed -i "${path_hack_script}" enchant/_enchant.py

    # They hardcode a bad path for Darwin in their library search code
    substituteInPlace enchant/_enchant.py --replace '/opt/local/lib/' ""
  '';

  # dictionaries needed for tests
  doCheck = false;<commit_msg>python: pyenchant: 1.6.6 -> 2.0.0<commit_after>{ stdenv
, buildPythonPackage
, fetchPypi
, pkgs
}:

buildPythonPackage rec {
  pname = "pyenchant";
  version = "2.0.0";

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

  propagatedBuildInputs = [ pkgs.enchant ];

  patchPhase = let
    path_hack_script = "s|LoadLibrary(e_path)|LoadLibrary('${pkgs.enchant}/lib/' + e_path)|";
  in ''
    sed -i "${path_hack_script}" enchant/_enchant.py

    # They hardcode a bad path for Darwin in their library search code
    substituteInPlace enchant/_enchant.py --replace '/opt/local/lib/' ""
  '';

  # dictionaries needed for tests
  doCheck = false;
{'fraction_non_alphanumeric': 0.12273361227336123, 'fraction_numerical': 0.06834030683403068, 'mean_word_length': 3.914383561643836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '5039958', 'n_tokens_mistral': 596, 'n_tokens_neox': 532, 'n_words': 106}