1{ lib 2, buildPythonPackage 3, fetchPypi 4, cython_3 5, isPyPy 6, ipython 7, scikit-build 8, cmake 9, pythonOlder 10, pytestCheckHook 11, ubelt 12}: 13 14buildPythonPackage rec { 15 pname = "line-profiler"; 16 version = "4.1.2"; 17 format = "setuptools"; 18 19 disabled = pythonOlder "3.6" || isPyPy; 20 21 src = fetchPypi { 22 pname = "line_profiler"; 23 inherit version; 24 hash = "sha256-qlZXiw/1p1b+GAs/2nvWfCe71Hiz0BJGEtjPAOSiHfI="; 25 }; 26 27 nativeBuildInputs = [ 28 cython_3 29 cmake 30 scikit-build 31 ]; 32 33 passthru.optional-dependencies = { 34 ipython = [ ipython ]; 35 }; 36 37 nativeCheckInputs = [ 38 pytestCheckHook 39 ubelt 40 ] ++ passthru.optional-dependencies.ipython; 41 42 dontUseCmakeConfigure = true; 43 44 preBuild = '' 45 rm -f _line_profiler.c 46 ''; 47 48 preCheck = '' 49 rm -r line_profiler 50 export PATH=$out/bin:$PATH 51 ''; 52 53 pythonImportsCheck = [ 54 "line_profiler" 55 ]; 56 57 meta = with lib; { 58 description = "Line-by-line profiler"; 59 homepage = "https://github.com/pyutils/line_profiler"; 60 changelog = "https://github.com/pyutils/line_profiler/blob/v${version}/CHANGELOG.rst"; 61 license = licenses.bsd3; 62 maintainers = with maintainers; [ fridh ]; 63 }; 64}