1{ lib
2, fetchPypi
3, buildPythonPackage
4, pythonOlder
5, Theano
6, pandas
7, patsy
8, joblib
9, tqdm
10, six
11, h5py
12, pytest
13, nose
14, parameterized
15}:
16
17buildPythonPackage rec {
18 pname = "pymc3";
19 version = "3.5";
20 disabled = pythonOlder "3.5";
21
22 src = fetchPypi {
23 inherit pname version;
24 sha256 = "6088e683c6d730bb21350a0f54ee083fa5a28e4d5ef52d57878141c9c20f21ee";
25 };
26
27 # No need for coverage stats in Nix builds
28 postPatch = ''
29 substituteInPlace setup.py --replace ", 'pytest-cov'" ""
30 '';
31
32 propagatedBuildInputs = [
33 Theano
34 pandas
35 patsy
36 joblib
37 tqdm
38 six
39 h5py
40 ];
41
42 checkInputs = [
43 pytest
44 nose
45 parameterized
46 ];
47
48 # The test suite is computationally intensive and test failures are not
49 # indicative for package usability hence tests are disabled by default.
50 doCheck = false;
51
52 # For some reason tests are run as a part of the *install* phase if enabled.
53 # Theano writes compiled code to ~/.theano hence we set $HOME.
54 preInstall = "export HOME=$(mktemp -d)";
55 postInstall = "rm -rf $HOME";
56
57 meta = {
58 description = "Bayesian estimation, particularly using Markov chain Monte Carlo (MCMC)";
59 homepage = https://github.com/pymc-devs/pymc3;
60 license = lib.licenses.asl20;
61 maintainers = with lib.maintainers; [ ilya-kolpakov ];
62 };
63}