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 = "4.0.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-JejJ1CSNxIkFgBhR/4p1ucdIJ6CHHRGNEQTY5D1/sPw=";
25 };
26
27 nativeBuildInputs = [
28 cython
29 cmake
30 scikit-build
31 ];
32
33 propagatedBuildInputs = [
34 ipython
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 ];
40
41 dontUseCmakeConfigure = true;
42
43 preBuild = ''
44 rm -f _line_profiler.c
45 '';
46
47 checkPhase = ''
48 PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH cd tests && ${python.interpreter} -m unittest discover -s .
49 '';
50
51 pythonImportsCheck = [
52 "line_profiler"
53 ];
54
55 meta = with lib; {
56 description = "Line-by-line profiler";
57 homepage = "https://github.com/pyutils/line_profiler";
58 changelog = "https://github.com/pyutils/line_profiler/blob/v${version}/CHANGELOG.rst";
59 license = licenses.bsd3;
60 maintainers = with maintainers; [ fridh ];
61 };
62}