about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/trackpy/default.nix
blob: ff4c4a767583aaf711dd8fca6abb0e91ad2c4d25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib, stdenv
, buildPythonPackage
, fetchFromGitHub
, numpy
, scipy
, six
, pandas
, pyyaml
, matplotlib
, pytest
}:

buildPythonPackage rec {
  pname = "trackpy";
  version = "0.4.2";

  src = fetchFromGitHub {
    owner = "soft-matter";
    repo = pname;
    rev = "v${version}";
    sha256 = "16mc22z3104fvygky4gy3gvifjijm42db48v2z1y0fmyf6whi9p6";
  };

  propagatedBuildInputs = [
    numpy
    scipy
    six
    pandas
    pyyaml
    matplotlib
  ];

  checkInputs = [
    pytest
  ];

  checkPhase = ''
    ${lib.optionalString (stdenv.isDarwin) ''
    # specifically needed for darwin
    export HOME=$(mktemp -d)
    mkdir -p $HOME/.matplotlib
    echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
    ''}

    pytest trackpy --ignore trackpy/tests/test_motion.py \
                   --ignore trackpy/tests/test_feature_saving.py \
                   --ignore trackpy/tests/test_feature.py \
                   --ignore trackpy/tests/test_plots.py \
                   --ignore trackpy/tests/test_legacy_linking.py
  '';

  meta = with lib; {
    description = "Particle-tracking toolkit";
    homepage = "https://github.com/soft-matter/trackpy";
    license = licenses.bsd3;
    maintainers = [ maintainers.costrouc ];
    broken = true; # not compatible with latest pandas
  };
}