1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 numpy,
6 pytestCheckHook,
7 setuptools,
8}:
9
10buildPythonPackage rec {
11 pname = "numexpr";
12 version = "2.11.0";
13 pyproject = true;
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-dbLAGk7aLnw1e8Z6P1w912UGwVtf1NxChF7y4YIYG60=";
18 };
19
20 build-system = [
21 setuptools
22 numpy
23 ];
24
25 dependencies = [ numpy ];
26
27 preBuild = ''
28 # Remove existing site.cfg, use the one we built for numpy
29 ln -s ${numpy.cfg} site.cfg
30 '';
31
32 nativeCheckInputs = [ pytestCheckHook ];
33
34 preCheck = ''
35 pushd $out
36 '';
37
38 postCheck = ''
39 popd
40 '';
41
42 disabledTests = [
43 # fails on computers with more than 8 threads
44 # https://github.com/pydata/numexpr/issues/479
45 "test_numexpr_max_threads_empty_string"
46 "test_omp_num_threads_empty_string"
47 ];
48
49 pythonImportsCheck = [ "numexpr" ];
50
51 meta = with lib; {
52 description = "Fast numerical array expression evaluator for NumPy";
53 homepage = "https://github.com/pydata/numexpr";
54 license = licenses.mit;
55 maintainers = [ ];
56 };
57}