1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cython
5, oldest-supported-numpy
6, setuptools
7, wheel
8, scipy
9, numpy
10, pytestCheckHook
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "dtw-python";
16 version = "1.3.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchFromGitHub {
22 owner = "DynamicTimeWarping";
23 repo = "dtw-python";
24 rev = "v${version}";
25 hash = "sha256-7hQuo7dES9f08YZhCf+kxUkMlrr+bg1P7HHRCMv3bLk=";
26 };
27
28 nativeBuildInputs = [
29 cython
30 oldest-supported-numpy
31 setuptools
32 wheel
33 ];
34
35 propagatedBuildInputs = [
36 scipy
37 numpy
38 ];
39
40 # We need to run tests on real built package: https://github.com/NixOS/nixpkgs/issues/255262
41 preCheck = "cd $out";
42 nativeCheckInputs = [ pytestCheckHook ];
43 # tests/ are not included to output package, so we have to set path explicitly
44 pytestFlagsArray = [
45 "$src/tests"
46 ];
47
48 pythonImportsCheck = [ "dtw" ];
49
50 meta = with lib; {
51 description = "Python port of R's Comprehensive Dynamic Time Warp algorithms package";
52 homepage = "https://github.com/DynamicTimeWarping/dtw-python";
53 changelog = "https://github.com/DynamicTimeWarping/dtw-python/blob/${src.rev}/CHANGELOG.md";
54 license = licenses.gpl3Only;
55 maintainers = with maintainers; [ mbalatsko ];
56 };
57}