summary refs log tree commit diff
path: root/pkgs/development/python-modules/mastodon-py/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/mastodon-py/default.nix')
-rw-r--r--pkgs/development/python-modules/mastodon-py/default.nix32
1 files changed, 25 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/mastodon-py/default.nix b/pkgs/development/python-modules/mastodon-py/default.nix
index 64f7ac67fa0..5034346b9cf 100644
--- a/pkgs/development/python-modules/mastodon-py/default.nix
+++ b/pkgs/development/python-modules/mastodon-py/default.nix
@@ -7,20 +7,19 @@
 , http-ece
 , python-dateutil
 , python-magic
-, pytz
 , requests
 , six
 , pytestCheckHook
 , pytest-mock
 , pytest-vcr
 , requests-mock
+, setuptools
 }:
 
 buildPythonPackage rec {
   pname = "mastodon-py";
   version = "1.8.1";
-
-  format = "setuptools";
+  pyproject = true;
 
   src = fetchFromGitHub {
     owner = "halcy";
@@ -30,26 +29,45 @@ buildPythonPackage rec {
   };
 
   postPatch = ''
-    sed -i '/^addopts/d' setup.cfg
+    sed -i '/addopts/d' setup.cfg
   '';
 
+  nativeBuildInputs = [
+    setuptools
+  ];
+
   propagatedBuildInputs = [
     blurhash
-    cryptography
     decorator
-    http-ece
     python-dateutil
     python-magic
-    pytz
     requests
     six
   ];
 
+  passthru.optional-dependencies = {
+    blurhash = [
+      blurhash
+    ];
+    webpush = [
+      http-ece
+      cryptography
+    ];
+  };
+
   nativeCheckInputs = [
     pytestCheckHook
     pytest-mock
     pytest-vcr
     requests-mock
+    setuptools
+  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
+
+  disabledTests = [
+    "test_notifications_dismiss_pre_2_9_2"
+    "test_status_card_pre_2_9_2"
+    "test_stream_user_direct"
+    "test_stream_user_local"
   ];
 
   pythonImportsCheck = [ "mastodon" ];