From 73a5be34ee0383383d2eb73ee502d6c640f97179 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Feb 2021 09:18:10 +0100 Subject: [PATCH 1/3] python3Packages.slackclient: 2.5.0 -> 2.9.3 --- .../python-modules/slackclient/default.nix | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/slackclient/default.nix b/pkgs/development/python-modules/slackclient/default.nix index d990295bff61..4a3c29272186 100644 --- a/pkgs/development/python-modules/slackclient/default.nix +++ b/pkgs/development/python-modules/slackclient/default.nix @@ -1,15 +1,15 @@ { lib -, buildPythonPackage -, fetchFromGitHub , aiohttp -, black +, buildPythonPackage , codecov +, fetchFromGitHub , flake8 , isPy3k , mock +, psutil +, pytest-cov , pytest-mock , pytestCheckHook -, pytestcov , pytestrunner , requests , responses @@ -19,15 +19,15 @@ buildPythonPackage rec { pname = "python-slackclient"; - version = "2.5.0"; + version = "2.9.3"; disabled = !isPy3k; src = fetchFromGitHub { - owner = "slackapi"; - repo = pname; - rev = version; - sha256 = "1ngj1mivbln19546195k400w9yaw69g0w6is7c75rqwyxr8wgzsk"; + owner = "slackapi"; + repo = "python-slack-sdk"; + rev = "v${version}"; + sha256 = "1rfb7izgddv28ag37gdnv3sd8z2zysrxs7ad8x20x690zshpaq16"; }; propagatedBuildInputs = [ @@ -38,17 +38,21 @@ buildPythonPackage rec { ]; checkInputs = [ - black codecov flake8 mock + psutil + pytest-cov pytest-mock pytestCheckHook - pytestcov pytestrunner responses ]; + # Exclude tests that requires network features + pytestFlagsArray = [ "--ignore=integration_tests" ]; + disabledTests = [ "test_start_raises_an_error_if_rtm_ws_url_is_not_returned" ]; + pythonImportsCheck = [ "slack" ]; meta = with lib; { From b41db12efcff7e0703dd293f8a77ba80fbb6058a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Feb 2021 09:19:01 +0100 Subject: [PATCH 2/3] python3Packages.slack-sdk: init at 3.3.0 --- .../python-modules/slack-sdk/default.nix | 74 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/slack-sdk/default.nix diff --git a/pkgs/development/python-modules/slack-sdk/default.nix b/pkgs/development/python-modules/slack-sdk/default.nix new file mode 100644 index 000000000000..2a2f3bf42fb0 --- /dev/null +++ b/pkgs/development/python-modules/slack-sdk/default.nix @@ -0,0 +1,74 @@ +{ lib +, aiodns +, aiohttp +, boto3 +, buildPythonPackage +, codecov +, databases +, fetchFromGitHub +, flake8 +, flask-sockets +, isPy3k +, psutil +, pytest-asyncio +, pytest-cov +, pytestCheckHook +, pytestrunner +, sqlalchemy +, websocket_client +, websockets +}: + +buildPythonPackage rec { + pname = "slack-sdk"; + version = "3.3.0"; + disabled = !isPy3k; + + src = fetchFromGitHub { + owner = "slackapi"; + repo = "python-slack-sdk"; + rev = "v${version}"; + sha256 = "0nr1avxycvjnvg1n8r09xi4sc5h6i4b64pzfgq14l55dgi5sv1rx"; + }; + + propagatedBuildInputs = [ + aiodns + aiohttp + boto3 + sqlalchemy + websocket_client + websockets + ]; + + checkInputs = [ + codecov + databases + flake8 + flask-sockets + psutil + pytest-asyncio + pytest-cov + pytestCheckHook + pytestrunner + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + # Exclude tests that requires network features + pytestFlagsArray = [ "--ignore=integration_tests" ]; + disabledTests = [ + "test_start_raises_an_error_if_rtm_ws_url_is_not_returned" + "test_org_installation" + ]; + + pythonImportsCheck = [ "slack_sdk" ]; + + meta = with lib; { + description = "Slack Developer Kit for Python"; + homepage = "https://slack.dev/python-slack-sdk/"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e019628d1e2b..7fe755f48f77 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7220,6 +7220,8 @@ in { skorch = callPackage ../development/python-modules/skorch { }; + slack-sdk = callPackage ../development/python-modules/slack-sdk { }; + slackclient = callPackage ../development/python-modules/slackclient { }; sleekxmpp = callPackage ../development/python-modules/sleekxmpp { }; From 364bb10c1db8924794636010deff77ccf583bcb5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 5 Feb 2021 10:27:13 +0100 Subject: [PATCH 3/3] errbot: 6.1.1 -> 6.1.7 --- .../networking/errbot/default.nix | 121 ++++++++++-------- pkgs/top-level/all-packages.nix | 4 +- 2 files changed, 69 insertions(+), 56 deletions(-) diff --git a/pkgs/applications/networking/errbot/default.nix b/pkgs/applications/networking/errbot/default.nix index 642677a9addc..f4a44275b693 100644 --- a/pkgs/applications/networking/errbot/default.nix +++ b/pkgs/applications/networking/errbot/default.nix @@ -1,75 +1,90 @@ -{ lib, fetchFromGitHub, python, glibcLocales }: +{ lib +, ansi +, buildPythonApplication +, colorlog +, daemonize +, deepmerge +, dulwich +, fetchFromGitHub +, flask +, glibcLocales +, hypchat +, irc +, jinja2 +, markdown +, mock +, pyasn1 +, pyasn1-modules +, pygments +, pygments-markdown-lexer +, pyopenssl +, pytestCheckHook +, requests +, slackclient +, sleekxmpp +, telegram +, webtest +}: -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 { +buildPythonApplication rec { pname = "errbot"; - version = "6.1.1"; + version = "6.1.7"; src = fetchFromGitHub { owner = "errbotio"; repo = "errbot"; rev = version; - sha256 = "1s4dl1za5imwsv6j3y7m47dy91hmqd5n221kkqm9ni4mpzgpffz0"; + sha256 = "02h44qd3d91zy657hyqsw3gskgxg31848pw6zpb8dhd1x84z5y77"; }; 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 + + propagatedBuildInputs = [ + ansi + colorlog + daemonize + deepmerge + dulwich + flask + hypchat + irc + jinja2 + markdown + pyasn1 + pyasn1-modules + pygments + pygments-markdown-lexer + pyopenssl + requests + slackclient + sleekxmpp + telegram + webtest ]; - 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' - ''; + checkInputs = [ + mock + pytestCheckHook + ]; + + # Slack backend test has an import issue + pytestFlagsArray = [ "--ignore=tests/backend_tests/slack_test.py" ]; + + disabledTests = [ + "backup" + "broken_plugin" + "plugin_cycle" + ]; + + pythonImportsCheck = [ "errbot" ]; 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; + license = licenses.gpl3Plus; platforms = platforms.linux; # flaky on darwin, "RuntimeError: can't start new thread" }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5fb8b0cd463b..37e4bc6d6a11 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21834,9 +21834,7 @@ in eq10q = callPackage ../applications/audio/eq10q { }; - errbot = callPackage ../applications/networking/errbot { - python = python3; - }; + errbot = python3Packages.callPackage ../applications/networking/errbot { }; espeak-classic = callPackage ../applications/audio/espeak { };