2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchpatch
|
2022-07-18 16:21:45 +00:00
|
|
|
, cython
|
|
|
|
, gfortran
|
2023-07-15 17:15:38 +00:00
|
|
|
, git
|
|
|
|
, meson-python
|
|
|
|
, pkg-config
|
2024-01-02 11:29:13 +00:00
|
|
|
, blas
|
|
|
|
, lapack
|
2023-07-15 17:15:38 +00:00
|
|
|
, numpy
|
2023-10-09 19:29:22 +00:00
|
|
|
, setuptools
|
|
|
|
, wheel
|
2024-01-02 11:29:13 +00:00
|
|
|
, pytestCheckHook
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "scikit-misc";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.3.0";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "has2k1";
|
|
|
|
repo = "scikit-misc";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-XV3s+y3JdMr1770S91ek6Y7MqvTg7/2cphLQldUPe5s=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
patchShebangs .
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# unbound numpy and disable coverage testing in pytest
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2024-01-02 11:29:13 +00:00
|
|
|
--replace 'numpy==' 'numpy>=' \
|
|
|
|
--replace 'addopts = "' '#addopts = "'
|
|
|
|
|
|
|
|
# provide a version to use when git fails to get the tag
|
|
|
|
[[ -f skmisc/_version.py ]] || \
|
|
|
|
echo '__version__ = "${version}"' > skmisc/_version.py
|
2022-07-18 16:21:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-07-15 17:15:38 +00:00
|
|
|
cython
|
2022-07-18 16:21:45 +00:00
|
|
|
gfortran
|
2023-07-15 17:15:38 +00:00
|
|
|
git
|
|
|
|
meson-python
|
2023-10-09 19:29:22 +00:00
|
|
|
numpy
|
2023-07-15 17:15:38 +00:00
|
|
|
pkg-config
|
2023-10-09 19:29:22 +00:00
|
|
|
setuptools
|
|
|
|
wheel
|
2022-07-18 16:21:45 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-07-18 16:21:45 +00:00
|
|
|
numpy
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
blas
|
|
|
|
lapack
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dblas=${blas.pname}"
|
|
|
|
"-Dlapack=${lapack.pname}"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
# can not run tests from source directory
|
|
|
|
preCheck = ''
|
|
|
|
cd "$(mktemp -d)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"--pyargs skmisc"
|
2022-07-18 16:21:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"skmisc"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Miscellaneous tools for scientific computing";
|
|
|
|
homepage = "https://github.com/has2k1/scikit-misc";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ onny ];
|
|
|
|
};
|
|
|
|
}
|