b5f92a349c
GitOrigin-RevId: 7c9cc5a6e5d38010801741ac830a3f8fd667a7a0
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, cython
|
|
, oldest-supported-numpy
|
|
, setuptools
|
|
, wheel
|
|
, scipy
|
|
, numpy
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "dtw-python";
|
|
version = "1.3.0";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "DynamicTimeWarping";
|
|
repo = "dtw-python";
|
|
rev = "v${version}";
|
|
hash = "sha256-7hQuo7dES9f08YZhCf+kxUkMlrr+bg1P7HHRCMv3bLk=";
|
|
};
|
|
|
|
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";
|
|
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 ];
|
|
};
|
|
}
|