python/simplebayes: init at 1.5.8

The upstream tag actually says 1.5.7 but the commit actually bumps the
version to 1.5.8:

https://github.com/hickeroar/simplebayes/commit/b8da72c50d20b6f8c0d

We needed to patch the setup.py because the upstream project's setup.py
reads in the README.rst for the longDescription. That very README.rst
contains non-ASCII characters which in turn throws a decoding error with
Python 3 on Nix because I think this has to do with our setup.py wrapper
that doesn't seem to recognize the right encoding when using compile().

Tested by building against Python 2.7, 3.3, 3.4, 3.5 and 3.6.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2016-12-19 09:56:19 +01:00
parent 0c7afce7dd
commit a7d425758a
No known key found for this signature in database
GPG Key ID: 1DE8E48E57DB5436

View File

@ -23135,6 +23135,35 @@ in {
};
};
simplebayes = buildPythonPackage rec {
name = "simplebayes-${version}";
version = "1.5.8";
# Use GitHub instead of pypi, because it contains tests.
src = pkgs.fetchFromGitHub {
repo = "simplebayes";
owner = "hickeroar";
# NOTE: This is actually 1.5.8 but the tag is wrong!
rev = "1.5.7";
sha256 = "0mp7rvfdmpfxnka4czw3lv5kkh6gdxh6dm4r6hcln1zzfg9lxp4h";
};
checkInputs = [ self.nose self.mock ];
postPatch = optionalString isPy3k ''
sed -i -e 's/open *(\([^)]*\))/open(\1, encoding="utf-8")/' setup.py
'';
checkPhase = "nosetests tests/test.py";
meta = {
description = "Memory-based naive bayesian text classifier";
homepage = "https://github.com/hickeroar/simplebayes";
license = licenses.mit;
platforms = platforms.all;
};
};
simplegeneric = buildPythonPackage rec {
version = "0.8.1";
name = "simplegeneric-${version}";