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