Files
nixpkgs/pkgs/development/python-modules/dufte/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

52 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
importlib-metadata,
matplotlib,
numpy,
pytestCheckHook,
setuptools,
}:
buildPythonPackage rec {
pname = "dufte";
version = "0.2.29";
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "nschloe";
repo = "dufte";
rev = "v${version}";
hash = "sha256:0ccsmpj160xj6w503a948aw8icj55mw9414xnmijmmjvlwhm0p48";
};
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
matplotlib
numpy
]
++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
preCheck = ''
export HOME=$(mktemp -d)
mkdir -p $HOME/.config/matplotlib
echo "backend: ps" > $HOME/.config/matplotlib/matplotlibrc
ln -s $HOME/.config/matplotlib $HOME/.matplotlib
'';
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "dufte" ];
meta = {
description = "Clean matplotlib plots";
homepage = "https://github.com/nschloe/dufte";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ ris ];
};
}