2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cython
|
|
|
|
, oldest-supported-numpy
|
|
|
|
, setuptools
|
|
|
|
, wheel
|
|
|
|
, scipy
|
|
|
|
, numpy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dtw-python";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.4.2";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "DynamicTimeWarping";
|
|
|
|
repo = "dtw-python";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Y0XzAPc2iJIp799gXTO7bUcHuOrDyqkd64DulLbdcAg=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
oldest-supported-numpy
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
scipy
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
|
|
|
# We need to run tests on real built package: https://github.com/NixOS/nixpkgs/issues/255262
|
|
|
|
preCheck = "cd $out";
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
# tests/ are not included to output package, so we have to set path explicitly
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"$src/tests"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "dtw" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python port of R's Comprehensive Dynamic Time Warp algorithms package";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "dtw";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://github.com/DynamicTimeWarping/dtw-python";
|
|
|
|
changelog = "https://github.com/DynamicTimeWarping/dtw-python/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ mbalatsko ];
|
|
|
|
};
|
|
|
|
}
|