1{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder
2, pytestCheckHook, nose, glibcLocales, fetchpatch
3, numpy, scipy, matplotlib, h5py }:
4
5buildPythonPackage rec {
6 pname = "bayespy";
7 version = "0.5.22";
8
9 # Python 2 not supported and not some old Python 3 because MPL doesn't support
10 # them properly.
11 disabled = pythonOlder "3.4";
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "ed0057dc22bd392df4b3bba23536117e1b2866e3201b12c5a37428d23421a5ba";
16 };
17
18 patches = [
19 # Change from scipy to locally defined epsilon
20 # https://github.com/bayespy/bayespy/pull/126
21 (fetchpatch {
22 name = "locally-defined-epsilon.patch";
23 url = "https://github.com/bayespy/bayespy/commit/9be53bada763e19c2b6086731a6aa542ad33aad0.patch";
24 hash = "sha256-KYt/0GcaNWR9K9/uS2OXgK7g1Z+Bayx9+IQGU75Mpuo=";
25 })
26
27 # Fix deprecated numpy types
28 # https://sources.debian.org/src/python-bayespy/0.5.22-5/debian/patches/pr127-Fix-deprecated-numpy-types.patch/
29 ./pr127-Fix-deprecated-numpy-types.patch
30 ];
31
32 nativeCheckInputs = [ pytestCheckHook nose glibcLocales ];
33
34 propagatedBuildInputs = [ numpy scipy matplotlib h5py ];
35
36 disabledTests = [
37 # Assertion error
38 "test_message_to_parents"
39 ];
40
41 pythonImportsCheck = [ "bayespy" ];
42
43 meta = with lib; {
44 homepage = "http://www.bayespy.org";
45 description = "Variational Bayesian inference tools for Python";
46 license = licenses.mit;
47 maintainers = with maintainers; [ jluttine ];
48 };
49}