2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
2024-09-19 14:19:46 +00:00
|
|
|
cython,
|
2024-06-05 15:53:02 +00:00
|
|
|
hypothesis,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2024-09-19 14:19:46 +00:00
|
|
|
blis,
|
|
|
|
numpy_2,
|
2024-06-05 15:53:02 +00:00
|
|
|
gitUpdater,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "blis";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.0.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "explosion";
|
|
|
|
repo = "cython-blis";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "refs/tags/release-v${version}";
|
|
|
|
hash = "sha256-8JaQgTda1EBiZdSrZtKwJ8e/aDENQ+dMmTiH/t1ax5I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
postPatch = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
# The commit pinning numpy to version 2 doesn't have any functional changes:
|
|
|
|
# https://github.com/explosion/cython-blis/pull/108
|
|
|
|
# BLIS should thus work with numpy and numpy_2.
|
|
|
|
substituteInPlace pyproject.toml setup.py \
|
|
|
|
--replace-fail "numpy>=2.0.0,<3.0.0" numpy
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
# See https://github.com/numpy/numpy/issues/21079
|
2024-01-02 11:29:13 +00:00
|
|
|
# has no functional difference as the name is only used in log output
|
2022-11-02 22:02:43 +00:00
|
|
|
substituteInPlace blis/benchmark.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail 'numpy.__config__.blas_ilp64_opt_info["libraries"]' '["dummy"]'
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# remove src module, so tests use the installed module instead
|
|
|
|
rm -rf ./blis
|
2022-11-02 22:02:43 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [
|
2024-01-02 11:29:13 +00:00
|
|
|
setuptools
|
2024-09-19 14:19:46 +00:00
|
|
|
cython
|
|
|
|
numpy
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [ numpy ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
hypothesis
|
2024-01-02 11:29:13 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "blis" ];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
passthru = {
|
2024-09-19 14:19:46 +00:00
|
|
|
tests = {
|
|
|
|
numpy_2 = blis.overridePythonAttrs (old: {
|
|
|
|
numpy = numpy_2;
|
|
|
|
});
|
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
updateScript = gitUpdater {
|
2024-09-19 14:19:46 +00:00
|
|
|
rev-prefix = "release-v";
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-09-19 14:19:46 +00:00
|
|
|
changelog = "https://github.com/explosion/cython-blis/releases/tag/release-v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "BLAS-like linear algebra library";
|
|
|
|
homepage = "https://github.com/explosion/cython-blis";
|
|
|
|
license = licenses.bsd3;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ nickcao ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|