aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/networking/errbot
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/applications/networking/errbot
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/networking/errbot')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/networking/errbot/default.nix76
1 files changed, 76 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/networking/errbot/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/networking/errbot/default.nix
new file mode 100644
index 000000000000..642677a9addc
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/networking/errbot/default.nix
@@ -0,0 +1,76 @@
+{ lib, fetchFromGitHub, python, glibcLocales }:
+
+let
+ py = python.override {
+ packageOverrides = self: super: {
+ # errbot requires markdown<3, and is not compatible with it either.
+ markdown = super.markdown.overridePythonAttrs (oldAttrs: rec {
+ version = "2.6.11";
+ src = super.fetchPypi {
+ pname = "Markdown";
+ inherit version;
+ sha256 = "108g80ryzykh8bj0i7jfp71510wrcixdi771lf2asyghgyf8cmm8";
+ };
+ });
+
+ # errbot requires slackclient 1.x, see https://github.com/errbotio/errbot/pull/1367
+ # latest 1.x release would be 1.3.2, but it requires an older websocket_client than the one in nixpkgs
+ # so let's just vendor the known-working version until they've migrated to 2.x.
+ slackclient = super.slackclient.overridePythonAttrs (oldAttrs: rec {
+ version = "1.2.1";
+ pname = "slackclient";
+ src = fetchFromGitHub {
+ owner = "slackapi";
+ repo = "python-slackclient";
+ rev = version;
+ sha256 = "073fwf6fm2sqdp5ms3vm1v3ljh0pldi69k048404rp6iy3cfwkp0";
+ };
+
+ propagatedBuildInputs = with self; [ websocket_client requests six ];
+
+ checkInputs = with self; [ pytest codecov coverage mock pytestcov pytest-mock responses flake8 ];
+ # test_server.py fails because it needs connection (I think);
+ checkPhase = ''
+ py.test --cov-report= --cov=slackclient tests --ignore=tests/test_server.py
+ '';
+ });
+ };
+ };
+
+in
+py.pkgs.buildPythonApplication rec {
+ pname = "errbot";
+ version = "6.1.1";
+
+ src = fetchFromGitHub {
+ owner = "errbotio";
+ repo = "errbot";
+ rev = version;
+ sha256 = "1s4dl1za5imwsv6j3y7m47dy91hmqd5n221kkqm9ni4mpzgpffz0";
+ };
+
+ LC_ALL = "en_US.utf8";
+
+ buildInputs = [ glibcLocales ];
+ propagatedBuildInputs = with py.pkgs; [
+ webtest requests jinja2 flask dulwich
+ pyopenssl colorlog markdown ansi pygments
+ daemonize pygments-markdown-lexer telegram irc slackclient
+ sleekxmpp pyasn1 pyasn1-modules hypchat
+ ];
+
+ checkInputs = with py.pkgs; [ mock pytest ];
+ # avoid tests that do network calls
+ checkPhase = ''
+ pytest tests -k 'not backup and not broken_plugin and not plugin_cycle'
+ '';
+
+ meta = with lib; {
+ description = "Chatbot designed to be simple to extend with plugins written in Python";
+ homepage = "http://errbot.io/";
+ maintainers = with maintainers; [ fpletz globin ];
+ license = licenses.gpl3;
+ platforms = platforms.linux;
+ # flaky on darwin, "RuntimeError: can't start new thread"
+ };
+}