about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/trackpy/default.nix
blob: 2e26679ebf2a4ac70cc6df0aedf6efc11f7f21a7 (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
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, numpy
, scipy
, six
, pandas
, pyyaml
, matplotlib
, pytest
}:

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

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

  propagatedBuildInputs = [
    numpy
    scipy
    six
    pandas
    pyyaml
    matplotlib
  ];

  checkInputs = [
    pytest
  ];

  checkPhase = ''
    ${stdenv.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_legacy_linking.py
  '';

  meta = with stdenv.lib; {
    description = "Particle-tracking toolkit";
    homepage = https://github.com/soft-matter/trackpy;
    license = licenses.bsd3;
    maintainers = [ maintainers.costrouc ];
  };
}