1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, fetchpatch 5, cython 6, gfortran 7, git 8, meson-python 9, pkg-config 10, blas 11, lapack 12, numpy 13, setuptools 14, wheel 15, pytestCheckHook 16}: 17 18buildPythonPackage rec { 19 pname = "scikit-misc"; 20 version = "0.3.0"; 21 pyproject = true; 22 23 src = fetchFromGitHub { 24 owner = "has2k1"; 25 repo = "scikit-misc"; 26 rev = "refs/tags/v${version}"; 27 hash = "sha256-XV3s+y3JdMr1770S91ek6Y7MqvTg7/2cphLQldUPe5s="; 28 }; 29 30 postPatch = '' 31 patchShebangs . 32 33 # unbound numpy and disable coverage testing in pytest 34 substituteInPlace pyproject.toml \ 35 --replace 'numpy==' 'numpy>=' \ 36 --replace 'addopts = "' '#addopts = "' 37 38 # provide a version to use when git fails to get the tag 39 [[ -f skmisc/_version.py ]] || \ 40 echo '__version__ = "${version}"' > skmisc/_version.py 41 ''; 42 43 nativeBuildInputs = [ 44 cython 45 gfortran 46 git 47 meson-python 48 numpy 49 pkg-config 50 setuptools 51 wheel 52 ]; 53 54 propagatedBuildInputs = [ 55 numpy 56 ]; 57 58 buildInputs = [ 59 blas 60 lapack 61 ]; 62 63 mesonFlags = [ 64 "-Dblas=${blas.pname}" 65 "-Dlapack=${lapack.pname}" 66 ]; 67 68 nativeCheckInputs = [ 69 pytestCheckHook 70 ]; 71 72 # can not run tests from source directory 73 preCheck = '' 74 cd "$(mktemp -d)" 75 ''; 76 77 pytestFlagsArray = [ 78 "--pyargs skmisc" 79 ]; 80 81 pythonImportsCheck = [ 82 "skmisc" 83 ]; 84 85 meta = with lib; { 86 description = "Miscellaneous tools for scientific computing"; 87 homepage = "https://github.com/has2k1/scikit-misc"; 88 license = licenses.bsd3; 89 maintainers = with maintainers; [ onny ]; 90 }; 91}