about summary refs log tree commit diff
path: root/pkgs/development/python-modules/remarshal/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/remarshal/default.nix')
-rw-r--r--pkgs/development/python-modules/remarshal/default.nix42
1 files changed, 37 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/remarshal/default.nix b/pkgs/development/python-modules/remarshal/default.nix
index 90024e7325764..99c868eb0b804 100644
--- a/pkgs/development/python-modules/remarshal/default.nix
+++ b/pkgs/development/python-modules/remarshal/default.nix
@@ -1,22 +1,54 @@
-{ lib, buildPythonApplication, fetchPypi
+{ lib
+, buildPythonApplication
+, fetchFromGitHub
+
+# build deps
+, poetry-core
+
+# propagates
 , cbor2
 , python-dateutil
 , pyyaml
 , tomlkit
 , u-msgpack-python
+
+# tested using
+, pytestCheckHook
 }:
 
 buildPythonApplication rec {
   pname = "remarshal";
   version = "0.14.0";
+  format = "pyproject";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "16425aa1575a271dd3705d812b06276eeedc3ac557e7fd28e06822ad14cd0667";
+  src = fetchFromGitHub {
+    owner = "dbohdan";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256:nTM3jrPf0kGE15J+ZXBIt2+NGSW2a6VlZCKj70n5kHM=";
   };
 
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace "poetry.masonry.api" "poetry.core.masonry.api" \
+      --replace 'PyYAML = "^5.3"' 'PyYAML = "*"' \
+      --replace 'tomlkit = "^0.7"' 'tomlkit = "*"'
+  '';
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
   propagatedBuildInputs = [
-    pyyaml cbor2 python-dateutil tomlkit u-msgpack-python
+    cbor2
+    python-dateutil
+    pyyaml
+    tomlkit
+    u-msgpack-python
+  ];
+
+  checkInputs = [
+    pytestCheckHook
   ];
 
   meta = with lib; {