about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dufte
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2020-09-26 14:16:11 +0100
committerRobert Scott <code@humanleg.org.uk>2020-10-11 11:37:18 +0100
commitb5b8839e0a4ade7e10f783405cd634a9107911ef (patch)
tree3327cbf98c2b1275ce0369e710f192ea928002f7 /pkgs/development/python-modules/dufte
parent93b593ae53d061abf07930a08f883b4fdaa4afa5 (diff)
python3Packages.dufte: init at 0.2.9
Diffstat (limited to 'pkgs/development/python-modules/dufte')
-rw-r--r--pkgs/development/python-modules/dufte/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/dufte/default.nix b/pkgs/development/python-modules/dufte/default.nix
new file mode 100644
index 0000000000000..8fe2025923599
--- /dev/null
+++ b/pkgs/development/python-modules/dufte/default.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, isPy3k
+, pythonOlder
+, importlib-metadata
+, matplotlib
+, numpy
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "dufte";
+  version = "0.2.9";
+  disabled = !isPy3k;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0nkaczipbsm8c14j9svxry2wigmn5iharibb6b8g062sjaph8x17";
+  };
+  format = "pyproject";
+
+  propagatedBuildInputs = [
+    matplotlib
+    numpy
+  ] ++ stdenv.lib.optionals (pythonOlder "3.8") [
+    importlib-metadata
+  ];
+
+  preCheck = ''
+    export HOME=$TMPDIR
+    mkdir -p $HOME/.matplotlib
+    echo "backend: ps" > $HOME/.matplotlib/matplotlibrc
+  '';
+  checkInputs = [ pytestCheckHook ];
+  pythonImportsCheck = [ "dufte" ];
+
+  meta = with stdenv.lib; {
+    description = "Clean matplotlib plots";
+    homepage = "https://github.com/nschloe/dufte";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ris ];
+  };
+}