at 24.11-pre 1.8 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pythonOlder, 7 setuptools, 8 mpmath, 9 numpy, 10 pybind11, 11 pyfma, 12 eigen, 13 importlib-metadata, 14 pytestCheckHook, 15 matplotlib, 16 dufte, 17 perfplot, 18}: 19 20buildPythonPackage rec { 21 pname = "accupy"; 22 version = "0.3.6"; 23 pyproject = true; 24 25 disabled = pythonOlder "3.7"; 26 27 src = fetchFromGitHub { 28 owner = "nschloe"; 29 repo = "accupy"; 30 rev = version; 31 hash = "sha256-xxwLmL/rFgDFQNr8mRBFG1/NArQk9wanelL4Lu7ls2s="; 32 }; 33 34 build-system = [ 35 setuptools 36 pybind11 37 ]; 38 39 buildInputs = [ eigen ]; 40 41 dependencies = [ 42 mpmath 43 numpy 44 pyfma 45 ] ++ lib.optional (pythonOlder "3.8") importlib-metadata; 46 47 nativeCheckInputs = [ 48 perfplot 49 pytestCheckHook 50 matplotlib 51 dufte 52 ]; 53 54 postConfigure = '' 55 substituteInPlace setup.py \ 56 --replace-fail "/usr/include/eigen3/" "${eigen}/include/eigen3/" 57 ''; 58 59 preBuild = '' 60 export HOME=$(mktemp -d) 61 ''; 62 63 # This variable is needed to suppress the "Trace/BPT trap: 5" error in Darwin's checkPhase. 64 # Not sure of the details, but we can avoid it by changing the matplotlib backend during testing. 65 env.MPLBACKEND = lib.optionalString stdenv.isDarwin "Agg"; 66 67 # performance tests aren't useful to us and disabling them allows us to 68 # decouple ourselves from an unnecessary build dep 69 preCheck = '' 70 for f in test/test*.py ; do 71 substituteInPlace $f --replace-quiet 'import perfplot' "" 72 done 73 ''; 74 75 disabledTests = [ 76 "test_speed_comparison1" 77 "test_speed_comparison2" 78 ]; 79 80 pythonImportsCheck = [ "accupy" ]; 81 82 meta = with lib; { 83 description = "Accurate sums and dot products for Python"; 84 homepage = "https://github.com/nschloe/accupy"; 85 license = licenses.mit; 86 maintainers = [ ]; 87 }; 88}