nixpkgs/pkgs/development/python-modules/dufte/default.nix
2021-02-02 14:46:11 +01:00

47 lines
911 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
, pythonOlder
, importlib-metadata
, matplotlib
, numpy
, exdown
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "dufte";
version = "0.2.12";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "0ag1d7h1wijkc7v2vpgkbqjlnpiwd4nh8zhxiby0989bpmlp3jr3";
};
format = "pyproject";
propagatedBuildInputs = [
matplotlib
numpy
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
preCheck = ''
export HOME=$TMPDIR
mkdir -p $HOME/.matplotlib
echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
'';
checkInputs = [ exdown pytestCheckHook ];
pythonImportsCheck = [ "dufte" ];
meta = with lib; {
description = "Clean matplotlib plots";
homepage = "https://github.com/nschloe/dufte";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ris ];
};
}