about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pathy/default.nix
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-04-30 23:53:51 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2022-05-01 09:45:46 +0200
commite3f55d56f5d21c21baa34460400d26b4b77d06e5 (patch)
tree488221a1dc7dc543d583069bd563668e8e8344d1 /pkgs/development/python-modules/pathy/default.nix
parentce38d2669c70cde5bc4a130e65bf0d74d604914c (diff)
python310Packages.pathy: support later smart-open releases
Diffstat (limited to 'pkgs/development/python-modules/pathy/default.nix')
-rw-r--r--pkgs/development/python-modules/pathy/default.nix51
1 files changed, 37 insertions, 14 deletions
diff --git a/pkgs/development/python-modules/pathy/default.nix b/pkgs/development/python-modules/pathy/default.nix
index aba6fdccb3274..30cdd782df2ed 100644
--- a/pkgs/development/python-modules/pathy/default.nix
+++ b/pkgs/development/python-modules/pathy/default.nix
@@ -1,36 +1,59 @@
 { lib
 , buildPythonPackage
+, dataclasses
 , fetchPypi
+, fetchpatch
+, google-cloud-storage
+, mock
 , pytestCheckHook
-, typer
+, pythonOlder
 , smart-open
-, mock
-, google-cloud-storage
+, typer
 }:
 
 buildPythonPackage rec {
   pname = "pathy";
   version = "0.6.1";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.6";
 
   src = fetchPypi {
     inherit pname version;
     sha256 = "838624441f799a06b446a657e4ecc9ebc3fdd05234397e044a7c87e8f6e76b1c";
   };
 
-  propagatedBuildInputs = [ smart-open typer google-cloud-storage ];
+  propagatedBuildInputs = [
+    smart-open
+    typer
+    google-cloud-storage
+  ] ++ lib.optionals (pythonOlder "3.7") [
+    dataclasses
+  ];
+
+  checkInputs = [
+    mock
+    pytestCheckHook
+  ];
 
-  postPatch = ''
-    substituteInPlace requirements.txt \
-      --replace "smart-open>=2.2.0,<4.0.0" "smart-open>=2.2.0"
-  '';
+  patches = [
+    # Support for smart-open >= 6.0.0, https://github.com/justindujardin/pathy/pull/71
+    (fetchpatch {
+      name = "support-later-smart-open.patch";
+      url = "https://github.com/justindujardin/pathy/commit/ba1c23df6ee5d1e57bdfe845ff6a9315cba3df6a.patch";
+      sha256 = "sha256-V1i4tx73Xkdqb/wZhQIv4p6FVpF9SEfDhlBkwaaRE3w=";
+    })
+  ];
 
-  checkInputs = [ pytestCheckHook mock ];
+  disabledTestPaths = [
+    # Exclude tests that require provider credentials
+    "pathy/_tests/test_clients.py"
+    "pathy/_tests/test_gcs.py"
+    "pathy/_tests/test_s3.py"
+  ];
 
-  # Exclude tests that require provider credentials
-  pytestFlagsArray = [
-    "--ignore=pathy/_tests/test_clients.py"
-    "--ignore=pathy/_tests/test_gcs.py"
-    "--ignore=pathy/_tests/test_s3.py"
+  pythonImportsCheck = [
+    "pathy"
   ];
 
   meta = with lib; {