1{ lib 2, buildPythonPackage 3, fetchPypi 4, python 5, numpy 6}: 7 8buildPythonPackage rec { 9 pname = "numexpr"; 10 version = "2.6.4"; 11 12 src = fetchPypi { 13 inherit pname version; 14 sha256 = "f0bef9a3a5407fb8d6344cf91b658bef7c13ec8a8eb13f423822d9d2ca5af6ce"; 15 }; 16 17 propagatedBuildInputs = [ numpy ]; 18 19 # Run the test suite. 20 # It requires the build path to be in the python search path. 21 checkPhase = '' 22 ${python}/bin/${python.executable} <<EOF 23 import sysconfig 24 import sys 25 import os 26 f = "lib.{platform}-{version[0]}.{version[1]}" 27 lib = f.format(platform=sysconfig.get_platform(), 28 version=sys.version_info) 29 build = os.path.join(os.getcwd(), 'build', lib) 30 sys.path.insert(0, build) 31 import numexpr 32 r = numexpr.test() 33 if not r.wasSuccessful(): 34 sys.exit(1) 35 EOF 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}