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