1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 nose, 6 mock, 7 isPy3k, 8}: 9 10buildPythonPackage { 11 pname = "simplebayes"; 12 version = "1.5.8"; 13 format = "setuptools"; 14 15 # Use GitHub instead of pypi, because it contains tests. 16 src = fetchFromGitHub { 17 repo = "simplebayes"; 18 owner = "hickeroar"; 19 # NOTE: This is actually 1.5.8 but the tag is wrong! 20 rev = "1.5.7"; 21 sha256 = "0mp7rvfdmpfxnka4czw3lv5kkh6gdxh6dm4r6hcln1zzfg9lxp4h"; 22 }; 23 24 nativeCheckInputs = [ 25 nose 26 mock 27 ]; 28 29 postPatch = lib.optionalString isPy3k '' 30 sed -i -e 's/open *(\([^)]*\))/open(\1, encoding="utf-8")/' setup.py 31 ''; 32 33 checkPhase = "nosetests tests/test.py"; 34 35 meta = with lib; { 36 description = "Memory-based naive bayesian text classifier"; 37 homepage = "https://github.com/hickeroar/simplebayes"; 38 license = licenses.mit; 39 }; 40}