<commit_before>{ stdenv
, buildPythonPackage
, fetchFromGitHub
, nose
, noise
, numpy
, pyplatec
, protobuf
, purepng
, h5py
, gdal
}:

buildPythonPackage rec {
  pname = "worldengine";
  version = "0.19.0";

  src = fetchFromGitHub {
    owner = "Mindwerks";
    repo = "worldengine";
    rev = "v${version}";
    sha256 = "1xrckb0dn2841gvp32n18gib14bpi77hmjw3r9jiyhg402iip7ry";
  };

  src-data = fetchFromGitHub {
    owner = "Mindwerks";
    repo = "worldengine-data";
    rev = "029051e";
    sha256 = "06xbf8gj3ljgr11v1n8jbs2q8pdf9wz53xdgkhpm8hdnjahgdxdm";
  };

  postUnpack = ''
    ln -s ${src-data} worldengine-data
  '';

  buildInputs = [ nose ];
  propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng h5py gdal ];

  prePatch = ''
    substituteInPlace setup.py \
      --replace pypng>=0.0.18 purepng \
      --replace 'numpy>=1.9.2, <= 1.10.0.post2' 'numpy' \
      --replace 'argparse==1.2.1' "" \
      --replace 'protobuf==3.0.0a3' 'protobuf' \
      --replace 'noise==1.2.2' 'noise' \
      --replace 'PyPlatec==1.4.0' 'PyPlatec' \
  '';

  doCheck = true;

  postCheck = ''
    nosetests tests
  '';

  meta = with stdenv.lib; {
    homepage = http://world-engine.org;
    description = "World generator using simulation of plates, rain shadow, erosion, etc";
    license = licenses.mit;
    maintainers = with maintainers; [ rardiol ];
  };

}<commit_msg>pythonPackages.worldengine: fix tests by moving nose to checkInputs<commit_after>{ stdenv
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, nose
, noise
, numpy
, pyplatec
, protobuf
, purepng
, h5py
, gdal
}:

buildPythonPackage rec {
  pname = "worldengine";
  version = "0.19.0";

  src = fetchFromGitHub {
    owner = "Mindwerks";
    repo = "worldengine";
    rev = "v${version}";
    sha256 = "1xrckb0dn2841gvp32n18gib14bpi77hmjw3r9jiyhg402iip7ry";
  };

  src-data = fetchFromGitHub {
    owner = "Mindwerks";
    repo = "worldengine-data";
    rev = "029051e";
    sha256 = "06xbf8gj3ljgr11v1n8jbs2q8pdf9wz53xdgkhpm8hdnjahgdxdm";
  };

  postUnpack = ''
    ln -s ${src-data} worldengine-data
  '';

  propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng h5py gdal ];

  prePatch = ''
    substituteInPlace setup.py \
      --replace pypng>=0.0.18 purepng \
      --replace 'numpy>=1.9.2, <= 1.10.0.post2' 'numpy' \
      --replace 'argparse==1.2.1' "" \
      --replace 'protobuf==3.0.0a3' 'protobuf' \
      --replace 'noise==1.2.2' 'noise' \
      --replace 'PyPlatec==1.4.0' 'PyPlatec' \
  '';

  # with python<3.5, unittest fails to discover tests because of their filenames
  # so nose is used instead.
  checkInputs = stdenv.lib.optional (pythonOlder "3.5") [ nose ];
  postCheck = stdenv.lib.optionalString (pythonOlder "3.5") ''
    nosetests tests
  '';

  meta = with stdenv.lib; {
    homepage = http://world-engine.org;
    description = "World generator using simulation of plates, rain shadow, erosion, etc";
    license = licenses.mit;
    maintainers = with maintainers; [ rardiol ];
  };

}
{'fraction_non_alphanumeric': 0.14276250414044386, 'fraction_numerical': 0.052997681351440874, 'mean_word_length': 3.0646029609690446, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, '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': '976553', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1154, 'n_words': 230}