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