Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 1.9 kB view raw
1{ lib 2, fetchPypi 3, buildPythonPackage 4, pythonOlder 5, Theano 6, pandas 7, patsy 8, joblib 9, tqdm 10, six 11, h5py 12, arviz 13, packaging 14, pytest 15, nose 16, parameterized 17, fastprogress 18, typing-extensions 19, libredirect 20}: 21 22buildPythonPackage rec { 23 pname = "pymc3"; 24 version = "3.9.3"; 25 disabled = pythonOlder "3.5"; 26 27 src = fetchPypi { 28 inherit pname version; 29 sha256 = "abe046f5a5d0e5baee80b7c4bc0a4c218f61b517b62d77be4f89cf4784c27d78"; 30 }; 31 32 # No need for coverage stats in Nix builds 33 postPatch = '' 34 substituteInPlace setup.py --replace ", 'pytest-cov'" "" 35 ''; 36 37 propagatedBuildInputs = [ 38 Theano 39 pandas 40 patsy 41 joblib 42 tqdm 43 six 44 h5py 45 arviz 46 packaging 47 fastprogress 48 typing-extensions 49 ]; 50 51 checkInputs = [ 52 pytest 53 nose 54 parameterized 55 ]; 56 57 # The test suite is computationally intensive and test failures are not 58 # indicative for package usability hence tests are disabled by default. 59 doCheck = false; 60 pythonImportsCheck = [ "pymc3" ]; 61 62 # For some reason tests are run as a part of the *install* phase if enabled. 63 # Theano writes compiled code to ~/.theano hence we set $HOME. 64 # This branch is missing #97597 (and its predecessor #93560), meaning only 65 # "/tmp" is exempt from NIX_ENFORCE_PURITY's objections when theano is 66 # imported from within a nix build environment. Therefore use libredirect 67 # to convince the wrapper we are actually accessing "/tmp". 68 preInstall = '' 69 export HOME=$(mktemp -d) 70 71 export NIX_REDIRECTS=/tmp=$TMPDIR 72 export LD_PRELOAD=${libredirect}/lib/libredirect.so 73 export TEMP=/tmp 74 export TEMPDIR=/tmp 75 export TMP=/tmp 76 export TMPDIR=/tmp 77 ''; 78 79 meta = { 80 description = "Bayesian estimation, particularly using Markov chain Monte Carlo (MCMC)"; 81 homepage = "https://github.com/pymc-devs/pymc3"; 82 license = lib.licenses.asl20; 83 maintainers = with lib.maintainers; [ ilya-kolpakov ]; 84 }; 85}