summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorifurther <55025025+ifurther@users.noreply.github.com>2023-11-08 18:16:09 +0800
committerifurther <55025025+ifurther@users.noreply.github.com>2023-11-17 22:25:18 +0800
commitdecee17779843e8cee647888ef3ac6500511df91 (patch)
treea3891746ee70942b375f8cbfd0072b4fe04eadc7 /pkgs/development/python-modules
parentc7a324364e7d7ec6b5a3786651578e35dd7eace4 (diff)
downloadnixpkgs-decee17779843e8cee647888ef3ac6500511df91.tar
nixpkgs-decee17779843e8cee647888ef3ac6500511df91.tar.gz
nixpkgs-decee17779843e8cee647888ef3ac6500511df91.tar.bz2
nixpkgs-decee17779843e8cee647888ef3ac6500511df91.tar.lz
nixpkgs-decee17779843e8cee647888ef3ac6500511df91.tar.xz
nixpkgs-decee17779843e8cee647888ef3ac6500511df91.tar.zst
nixpkgs-decee17779843e8cee647888ef3ac6500511df91.zip
python3Packages.mpl-scatter-density: init at 0.7
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/mpl-scatter-density/default.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/mpl-scatter-density/default.nix b/pkgs/development/python-modules/mpl-scatter-density/default.nix
new file mode 100644
index 00000000000..f0523c3594d
--- /dev/null
+++ b/pkgs/development/python-modules/mpl-scatter-density/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, buildPythonPackage
+, pytestCheckHook
+, fetchFromGitHub
+, fetchpatch
+, pythonOlder
+, setuptools-scm
+, setuptools
+, fast-histogram
+, matplotlib
+, numpy
+, wheel
+, pytest-mpl
+}:
+
+buildPythonPackage rec {
+  pname = "mpl-scatter-density";
+  version = "0.7";
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "astrofrog";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-MMxM+iv5p9ZLcBpqa3tBBPbsMM/PTg6BXaDpGgSw+DE=";
+  };
+
+  patches = [
+    # https://github.com/astrofrog/mpl-scatter-density/pull/37
+    (fetchpatch {
+      name = "distutils-removal.patch";
+      url = "https://github.com/ifurther/mpl-scatter-density/commit/6feedabe1e82da67d8eec46a80eb370d9f334251.patch";
+      sha256 = "sha256-JqWlSm8mIwqjRPa+kMEaKipJyzGEO+gJK+Q045N1MXA=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    setuptools
+    setuptools-scm
+    wheel
+  ];
+
+  propagatedBuildInputs = [ matplotlib numpy fast-histogram ];
+
+  env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeCheckInputs = [
+    pytestCheckHook
+    pytest-mpl
+  ];
+
+  disabledTests = [
+    # AssertionError: (240, 240) != (216, 216)
+    # Erroneous pinning of figure DPI, sensitive to runtime environment
+    "test_default_dpi"
+  ];
+
+  pythonImportsCheck = [ "mpl_scatter_density" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/astrofrog/mpl-scatter-density";
+    description = "Fast scatter density plots for Matplotlib";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ ifurther ];
+  };
+}