Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.03 43 lines 877 B view raw
1{ lib 2, buildPythonPackage 3, fetchPypi 4, python 5, numpy 6}: 7 8buildPythonPackage rec { 9 pname = "numexpr"; 10 version = "2.7.1"; 11 12 src = fetchPypi { 13 inherit pname version; 14 sha256 = "1c82z0zx0542j9df6ckjz6pn1g13b21hbza4hghcw6vyhbckklmh"; 15 }; 16 17 # Remove existing site.cfg, use the one we built for numpy. 18 preBuild = '' 19 ln -s ${numpy.cfg} site.cfg 20 ''; 21 22 propagatedBuildInputs = [ numpy ]; 23 24 # Run the test suite. 25 # It requires the build path to be in the python search path. 26 checkPhase = '' 27 pushd $out 28 ${python}/bin/${python.executable} <<EOF 29 import sys 30 import numexpr 31 r = numexpr.test() 32 if not r.wasSuccessful(): 33 sys.exit(1) 34 EOF 35 popd 36 ''; 37 38 meta = { 39 description = "Fast numerical array expression evaluator for NumPy"; 40 homepage = "https://github.com/pydata/numexpr"; 41 license = lib.licenses.mit; 42 }; 43}