2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cython,
|
|
|
|
gfortran,
|
|
|
|
git,
|
|
|
|
meson-python,
|
|
|
|
pkg-config,
|
|
|
|
blas,
|
|
|
|
lapack,
|
|
|
|
numpy,
|
|
|
|
setuptools,
|
|
|
|
wheel,
|
|
|
|
pytestCheckHook,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "scikit-misc";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.3.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "has2k1";
|
|
|
|
repo = "scikit-misc";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-2L30hvKbFqIGlSEbzc1HvHybBqDGldJfZoUpqJJOv2Q=";
|
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-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ numpy ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
blas
|
|
|
|
lapack
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dblas=${blas.pname}"
|
|
|
|
"-Dlapack=${lapack.pname}"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
# can not run tests from source directory
|
|
|
|
preCheck = ''
|
|
|
|
cd "$(mktemp -d)"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "--pyargs skmisc" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "skmisc" ];
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Miscellaneous tools for scientific computing";
|
|
|
|
homepage = "https://github.com/has2k1/scikit-misc";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ onny ];
|
|
|
|
};
|
|
|
|
}
|