1{ lib 2, buildPythonPackage 3, fetchPypi 4, cython 5, isPyPy 6, ipython 7, python 8, scikit-build 9, cmake 10, pythonOlder 11, pytestCheckHook 12}: 13 14buildPythonPackage rec { 15 pname = "line-profiler"; 16 version = "3.5.1"; 17 18 disabled = pythonOlder "3.6" || isPyPy; 19 20 src = fetchPypi { 21 pname = "line_profiler"; 22 inherit version; 23 sha256 = "sha256-d0ACCL+9XUNBk4qaOk+1GU9a9/wjstSWyRN1X4MQ6Lg="; 24 }; 25 26 nativeBuildInputs = [ 27 cython 28 cmake 29 scikit-build 30 ]; 31 32 propagatedBuildInputs = [ 33 ipython 34 ]; 35 36 checkInputs = [ 37 pytestCheckHook 38 ]; 39 40 dontUseCmakeConfigure = true; 41 42 preBuild = '' 43 rm -f _line_profiler.c 44 ''; 45 46 checkPhase = '' 47 PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH cd tests && ${python.interpreter} -m unittest discover -s . 48 ''; 49 50 pythonImportsCheck = [ 51 "line_profiler" 52 ]; 53 54 meta = with lib; { 55 description = "Line-by-line profiler"; 56 homepage = "https://github.com/pyutils/line_profiler"; 57 license = licenses.bsd3; 58 maintainers = with maintainers; [ fridh ]; 59 }; 60}