nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 matplotlib,
6 numpy,
7 pytestCheckHook,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "dufte";
13 version = "0.2.29";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "nschloe";
18 repo = "dufte";
19 rev = "v${version}";
20 hash = "sha256:0ccsmpj160xj6w503a948aw8icj55mw9414xnmijmmjvlwhm0p48";
21 };
22
23 nativeBuildInputs = [ setuptools ];
24
25 propagatedBuildInputs = [
26 matplotlib
27 numpy
28 ];
29
30 preCheck = ''
31 export HOME=$(mktemp -d)
32 mkdir -p $HOME/.config/matplotlib
33 echo "backend: ps" > $HOME/.config/matplotlib/matplotlibrc
34 ln -s $HOME/.config/matplotlib $HOME/.matplotlib
35 '';
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 pythonImportsCheck = [ "dufte" ];
40
41 meta = {
42 description = "Clean matplotlib plots";
43 homepage = "https://github.com/nschloe/dufte";
44 license = lib.licenses.gpl3Plus;
45 maintainers = with lib.maintainers; [ ris ];
46 };
47}