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