Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / line-profiler / default.nix
blob10decb4f3f523125263772c87519c63a00715c6e
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , cython_3
5 , isPyPy
6 , ipython
7 , scikit-build
8 , cmake
9 , pythonOlder
10 , pytestCheckHook
11 , ubelt
14 buildPythonPackage rec {
15   pname = "line-profiler";
16   version = "4.1.2";
17   format = "setuptools";
19   disabled = pythonOlder "3.6" || isPyPy;
21   src = fetchPypi {
22     pname = "line_profiler";
23     inherit version;
24     hash = "sha256-qlZXiw/1p1b+GAs/2nvWfCe71Hiz0BJGEtjPAOSiHfI=";
25   };
27   nativeBuildInputs = [
28     cython_3
29     cmake
30     scikit-build
31   ];
33   passthru.optional-dependencies = {
34     ipython = [ ipython ];
35   };
37   nativeCheckInputs = [
38     pytestCheckHook
39     ubelt
40   ] ++ passthru.optional-dependencies.ipython;
42   dontUseCmakeConfigure = true;
44   preBuild = ''
45     rm -f _line_profiler.c
46   '';
48   preCheck = ''
49     rm -r line_profiler
50     export PATH=$out/bin:$PATH
51   '';
53   pythonImportsCheck = [
54     "line_profiler"
55   ];
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   };