1{ lib
2, stdenv
3, aiohttp
4, boto3
5, buildPythonPackage
6, fetchFromGitHub
7, flask
8, flask-sockets
9, pythonOlder
10, mock
11, moto
12, psutil
13, pytest-cov
14, pytest-mock
15, pytestCheckHook
16, pytest-runner
17, requests
18, responses
19, sqlalchemy
20, websockets
21, websocket-client
22}:
23
24buildPythonPackage rec {
25 pname = "slackclient";
26 version = "3.21.3";
27 format = "setuptools";
28
29 disabled = pythonOlder "3.6";
30
31 src = fetchFromGitHub {
32 owner = "slackapi";
33 repo = "python-slack-sdk";
34 rev = "refs/tags/v${version}";
35 hash = "sha256-begpT/DaDqOi8HZE10FCuIIv18KSU/i5G/Z5DXKUT7Y=";
36 };
37
38 propagatedBuildInputs = [
39 aiohttp
40 websocket-client
41 requests
42 ];
43
44 nativeCheckInputs = [
45 boto3
46 flask
47 flask-sockets
48 mock
49 moto
50 psutil
51 pytest-mock
52 pytestCheckHook
53 responses
54 sqlalchemy
55 websockets
56 ];
57
58 # Exclude tests that requires network features
59 pytestFlagsArray = [ "--ignore=integration_tests" ];
60
61 preCheck = ''
62 export HOME=$(mktemp -d)
63 '';
64
65 disabledTests = [
66 "test_start_raises_an_error_if_rtm_ws_url_is_not_returned"
67 "test_interactions"
68 "test_send_message_while_disconnection"
69 ] ++ lib.optionals stdenv.isDarwin [
70 # these fail with `ConnectionResetError: [Errno 54] Connection reset by peer`
71 "test_issue_690_oauth_access"
72 "test_issue_690_oauth_v2_access"
73 "test_send"
74 "test_send_attachments"
75 "test_send_blocks"
76 "test_send_dict"
77 ];
78
79 pythonImportsCheck = [ "slack" ];
80
81 meta = with lib; {
82 description = "A client for Slack, which supports the Slack Web API and Real Time Messaging (RTM) API";
83 homepage = "https://github.com/slackapi/python-slackclient";
84 changelog = "https://github.com/slackapi/python-slack-sdk/releases/tag/v${version}";
85 license = licenses.mit;
86 maintainers = with maintainers; [ flokli psyanticy ];
87 };
88}