about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pytest-mpl/default.nix
blob: edf0450366c5d4b85b9643e2780bf4f289f97bc8 (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
{ stdenv
, buildPythonPackage
, fetchPypi
, pytest
, matplotlib
, nose
}:

buildPythonPackage rec {
  pname = "pytest-mpl";
  version = "0.10";

  src = fetchPypi {
    inherit pname version;
    sha256 = "7006e63bf1ca9c50bea3d189c0f862751a16ce40bb373197b218f57af5b837c0";
  };

  buildInputs = [ pytest ];

  propagatedBuildInputs = [
    matplotlib
    nose
  ];

  checkInputs = [
    pytest
  ];

  checkPhase = ''
    export HOME=$(mktemp -d)
    mkdir -p $HOME/.config/matplotlib
    echo "backend: ps" > $HOME/.config/matplotlib/matplotlibrc
    ln -s $HOME/.config/matplotlib $HOME/.matplotlib

    pytest
  '';

  meta = with stdenv.lib; {
    description = "Pytest plugin to help with testing figures output from Matplotlib";
    homepage = https://github.com/matplotlib/pytest-mpl;
    license = licenses.bsd3;
    maintainers = [ maintainers.costrouc ];
  };
}