about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-09-12 17:00:02 +0200
committerGitHub <noreply@github.com>2020-09-12 17:00:02 +0200
commit8d25f838d04c84ddec97c75f9cb6f7dbc21e5468 (patch)
tree3c1a2c3f90fce826717f827f07674a94cb7e3b22 /pkgs
parent607509ac8f31794bdf9304eebf857d7137b60168 (diff)
parentf1eeb3245e32a8022975125f0d6750fae6855966 (diff)
Merge pull request #97817 from dotlambda/zulip-terminal
zulip-term: init at 0.5.2
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/networking/instant-messengers/zulip-term/default.nix46
-rw-r--r--pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch13
-rw-r--r--pkgs/development/python-modules/urwid-readline/default.nix33
-rw-r--r--pkgs/development/python-modules/zulip/default.nix41
-rw-r--r--pkgs/top-level/all-packages.nix2
-rw-r--r--pkgs/top-level/python-packages.nix4
6 files changed, 139 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/zulip-term/default.nix b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix
new file mode 100644
index 0000000000000..8f4b2200cc550
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, python3
+, fetchFromGitHub
+, glibcLocales
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "zulip-term";
+  version = "0.5.2";
+
+  # no tests on PyPI
+  src = fetchFromGitHub {
+    owner = "zulip";
+    repo = "zulip-terminal";
+    rev = version;
+    sha256 = "1xhhy3v4wck74a83avil0rnmsi2grrh03cww19n5mv80p2q1cjmf";
+  };
+
+  patches = [
+    ./pytest-executable-name.patch
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    urwid
+    zulip
+    urwid-readline
+    beautifulsoup4
+    lxml
+    mypy-extensions
+  ];
+
+  checkInputs = [
+    glibcLocales
+  ] ++ (with python3.pkgs; [
+    pytestCheckHook
+    pytestcov
+    pytest-mock
+  ]);
+
+  meta = with lib; {
+    description = "Zulip's official terminal client";
+    homepage = "https://github.com/zulip/zulip-terminal";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch b/pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch
new file mode 100644
index 0000000000000..4602a254ab88a
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch
@@ -0,0 +1,13 @@
+diff --git a/tests/cli/test_run.py b/tests/cli/test_run.py
+index 459aa82..c6e434e 100644
+--- a/tests/cli/test_run.py
++++ b/tests/cli/test_run.py
+@@ -180,7 +180,7 @@ def test_main_multiple_autohide_options(capsys, options):
+         assert str(e.value) == "2"
+     captured = capsys.readouterr()
+     lines = captured.err.strip('\n')
+-    lines = lines.split("pytest: ", 1)[1]
++    lines = lines.split("__main__.py: ", 1)[1]
+     expected = ("error: argument {}: not allowed "
+                 "with argument {}".format(options[1], options[0]))
+     assert lines == expected
diff --git a/pkgs/development/python-modules/urwid-readline/default.nix b/pkgs/development/python-modules/urwid-readline/default.nix
new file mode 100644
index 0000000000000..1ded152cba91c
--- /dev/null
+++ b/pkgs/development/python-modules/urwid-readline/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, urwid
+, glibcLocales
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "urwid_readline";
+  version = "0.11";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "24e376d4b75940d19e8bc81c264be5d383f8d4da560f68f648dd16c85f6afdb5";
+  };
+
+  propagatedBuildInputs = [
+    urwid
+  ];
+
+  checkInputs = [
+    glibcLocales
+    pytestCheckHook
+  ];
+
+  meta = with lib; {
+    description = "A textbox edit widget for urwid that supports readline shortcuts";
+    homepage = "https://github.com/rr-/urwid_readline";
+    license = licenses.mit;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/pkgs/development/python-modules/zulip/default.nix b/pkgs/development/python-modules/zulip/default.nix
new file mode 100644
index 0000000000000..229a4f17bd340
--- /dev/null
+++ b/pkgs/development/python-modules/zulip/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildPythonPackage
+, isPy3k
+, fetchFromGitHub
+, requests
+, matrix-client
+, distro
+}:
+
+buildPythonPackage rec {
+  pname = "zulip";
+  version = "0.7.0";
+
+  disabled = !isPy3k;
+
+  # no sdist on PyPI
+  src = fetchFromGitHub {
+    owner = "zulip";
+    repo = "python-zulip-api";
+    rev = version;
+    sha256 = "0waldgpzq3ms1r1z14lxdj56lf082fnmi83l3fn8i8gqr8nvnch1";
+  };
+  sourceRoot = "source/zulip";
+
+  propagatedBuildInputs = [
+    requests
+    matrix-client
+    distro
+  ];
+
+  preCheck = ''
+    export COLUMNS=80
+  '';
+
+  meta = with lib; {
+    description = "Bindings for the Zulip message API";
+    homepage = "https://github.com/zulip/python-zulip-api";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 23cca2cec7922..7ed564703132f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9865,6 +9865,8 @@ in
 
   zulip = callPackage ../applications/networking/instant-messengers/zulip { };
 
+  zulip-term = callPackage ../applications/networking/instant-messengers/zulip-term { };
+
   zulu8 = callPackage ../development/compilers/zulu/8.nix { };
   zulu = callPackage ../development/compilers/zulu { };
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 702e209650b99..ca39973e0025e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -7247,6 +7247,8 @@ in {
 
   urwidtrees = callPackage ../development/python-modules/urwidtrees { };
 
+  urwid-readline = callPackage ../development/python-modules/urwid-readline { };
+
   usbtmc = callPackage ../development/python-modules/usbtmc { };
 
   us = callPackage ../development/python-modules/us { };
@@ -7710,6 +7712,8 @@ in {
 
   zstd = callPackage ../development/python-modules/zstd { inherit (pkgs) zstd pkgconfig; };
 
+  zulip = callPackage ../development/python-modules/zulip { };
+
   zxcvbn = callPackage ../development/python-modules/zxcvbn { };
 
 });