about summary refs log tree commit diff
path: root/pkgs/development/python-modules/yowsup/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/yowsup/default.nix')
-rw-r--r--pkgs/development/python-modules/yowsup/default.nix64
1 files changed, 33 insertions, 31 deletions
diff --git a/pkgs/development/python-modules/yowsup/default.nix b/pkgs/development/python-modules/yowsup/default.nix
index a88a296944a5..75b05e352d0e 100644
--- a/pkgs/development/python-modules/yowsup/default.nix
+++ b/pkgs/development/python-modules/yowsup/default.nix
@@ -1,21 +1,23 @@
-{ lib
-, buildPythonPackage
-, pythonOlder
-, isPy3k
-, fetchFromGitHub
-, appdirs
-, consonance
-, protobuf
-, python-axolotl
-, six
-, pyasyncore
-, pytestCheckHook
+{
+  lib,
+  buildPythonPackage,
+  pythonOlder,
+  isPy3k,
+  fetchFromGitHub,
+  setuptools,
+  appdirs,
+  consonance,
+  protobuf,
+  python-axolotl,
+  six,
+  pyasyncore,
+  pytestCheckHook,
 }:
 
 buildPythonPackage rec {
   pname = "yowsup";
   version = "3.3.0";
-  format = "setuptools";
+  pyproject = true;
 
   # The Python 2.x support of this package is incompatible with `six==1.11`:
   # https://github.com/tgalal/yowsup/issues/2416#issuecomment-365113486
@@ -24,36 +26,36 @@ buildPythonPackage rec {
   src = fetchFromGitHub {
     owner = "tgalal";
     repo = "yowsup";
-    rev = "v${version}";
+    rev = "refs/tags/v${version}";
     sha256 = "1pz0r1gif15lhzdsam8gg3jm6zsskiv2yiwlhaif5rl7lv3p0v7q";
   };
 
-  postPatch = ''
-    substituteInPlace setup.py \
-      --replace "argparse" "" \
-      --replace "==" ">=" \
-  '';
+  pythonRelaxDeps = true;
+  pythonRemoveDeps = [ "argparse" ];
 
-  nativeCheckInputs = [
-    pytestCheckHook
-  ];
+  env = {
+    # make protobuf compatible with old versions
+    # https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
+    PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
+  };
+
+  build-system = [ setuptools ];
+
+  nativeCheckInputs = [ pytestCheckHook ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     appdirs
     consonance
     protobuf
     python-axolotl
     six
-  ]
-  ++ lib.optionals (!pythonOlder "3.12") [
-    pyasyncore
-  ];
+  ] ++ lib.optionals (!pythonOlder "3.12") [ pyasyncore ];
 
-  meta = with lib; {
+  meta = {
     homepage = "https://github.com/tgalal/yowsup";
-    description = "The python WhatsApp library";
+    description = "Python WhatsApp library";
     mainProgram = "yowsup-cli";
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ ];
+    license = lib.licenses.gpl3Plus;
+    maintainers = [ ];
   };
 }