summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-03-09 18:35:58 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-03-09 18:39:13 +0100
commit864941a5a80725bd81e1701c331e72be23f1c0e5 (patch)
tree7a6f0fa1dfcbb4bd3e1066858a29966fa170e8de
parentcd5d83212a38531636e2b557a6394e74347c9ed0 (diff)
downloadnixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.tar
nixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.tar.gz
nixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.tar.bz2
nixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.tar.lz
nixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.tar.xz
nixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.tar.zst
nixpkgs-864941a5a80725bd81e1701c331e72be23f1c0e5.zip
python310Packages.measurement: Fix build
-rw-r--r--pkgs/development/python-modules/measurement/default.nix35
1 files changed, 29 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/measurement/default.nix b/pkgs/development/python-modules/measurement/default.nix
index 5650170c31f..3323e8c198f 100644
--- a/pkgs/development/python-modules/measurement/default.nix
+++ b/pkgs/development/python-modules/measurement/default.nix
@@ -1,9 +1,18 @@
-{ lib, fetchFromGitHub, buildPythonPackage, isPy3k
-, sympy, pytest, pytest-runner, sphinx, setuptools-scm }:
+{ lib
+, fetchFromGitHub
+, buildPythonPackage
+, isPy3k
+, flit-core
+, flit-scm
+, sympy
+, pytestCheckHook
+, sphinx
+}:
 
 buildPythonPackage rec {
   pname = "measurement";
   version = "3.2.2";
+  format = "pyproject";
 
   disabled = !isPy3k;
 
@@ -14,17 +23,31 @@ buildPythonPackage rec {
     hash = "sha256-ULId0W10FaAtSgVY5ctQL3FPETVr+oq6TKWd/W53viM=";
   };
 
+  nativeBuildInputs = [
+    flit-core
+    flit-scm
+    sphinx
+  ];
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
   postPatch = ''
-    sed -i 's|use_scm_version=True|version="${version}"|' setup.py
+    substituteInPlace pyproject.toml \
+      --replace "--cov=measurement" ""
   '';
 
-  nativeCheckInputs = [ pytest pytest-runner ];
-  nativeBuildInputs = [ sphinx setuptools-scm ];
-  propagatedBuildInputs = [ sympy ];
+  propagatedBuildInputs = [
+    sympy
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
 
   meta = with lib; {
     description = "Use and manipulate unit-aware measurement objects in Python";
     homepage = "https://github.com/coddingtonbear/python-measurement";
+    changelog = "https://github.com/coddingtonbear/python-measurement/releases/tag/${version}";
     license = licenses.mit;
     maintainers = with maintainers; [ bhipple ];
   };