1{ stdenv
2, buildPythonPackage
3, fetchFromGitHub
4, numpy
5, scipy
6, six
7, pandas
8, pyyaml
9, matplotlib
10, pytest
11}:
12
13buildPythonPackage rec {
14 pname = "trackpy";
15 version = "0.4.2";
16
17 src = fetchFromGitHub {
18 owner = "soft-matter";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "16mc22z3104fvygky4gy3gvifjijm42db48v2z1y0fmyf6whi9p6";
22 };
23
24 propagatedBuildInputs = [
25 numpy
26 scipy
27 six
28 pandas
29 pyyaml
30 matplotlib
31 ];
32
33 checkInputs = [
34 pytest
35 ];
36
37 checkPhase = ''
38 ${stdenv.lib.optionalString (stdenv.isDarwin) ''
39 # specifically needed for darwin
40 export HOME=$(mktemp -d)
41 mkdir -p $HOME/.matplotlib
42 echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
43 ''}
44
45 pytest trackpy --ignore trackpy/tests/test_motion.py \
46 --ignore trackpy/tests/test_feature_saving.py \
47 --ignore trackpy/tests/test_feature.py \
48 --ignore trackpy/tests/test_plots.py \
49 --ignore trackpy/tests/test_legacy_linking.py
50 '';
51
52 meta = with stdenv.lib; {
53 description = "Particle-tracking toolkit";
54 homepage = "https://github.com/soft-matter/trackpy";
55 license = licenses.bsd3;
56 maintainers = [ maintainers.costrouc ];
57 broken = true; # not compatible with latest pandas
58 };
59}