about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/slackclient/default.nix
blob: a31f44b3ad6810d56e49d8cae9d3db2c8bf150f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{ lib
, stdenv
, aiohttp
, boto3
, buildPythonPackage
, fetchFromGitHub
, flask
, flask-sockets
, pythonOlder
, mock
, moto
, psutil
, pytest-mock
, pytestCheckHook
, requests
, responses
, sqlalchemy
, websockets
, websocket-client
}:

buildPythonPackage rec {
  pname = "slackclient";
  version = "3.23.0";
  format =  "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "slackapi";
    repo = "python-slack-sdk";
    rev = "refs/tags/v${version}";
    hash = "sha256-OsPwLOnmN3kvPmbM6lOaiTWwWvy7b9pgn1X536dCkWk=";
  };

  propagatedBuildInputs = [
    aiohttp
    websocket-client
    requests
  ];

  nativeCheckInputs = [
    boto3
    flask
    flask-sockets
    mock
    moto
    psutil
    pytest-mock
    pytestCheckHook
    responses
    sqlalchemy
    websockets
  ];

  pytestFlagsArray = [
    # Exclude tests that requires network features
    "--ignore=integration_tests"
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  disabledTests = [
    "test_start_raises_an_error_if_rtm_ws_url_is_not_returned"
    "test_interactions"
    "test_send_message_while_disconnection"
  ] ++ lib.optionals stdenv.isDarwin [
    # these fail with `ConnectionResetError: [Errno 54] Connection reset by peer`
    "test_issue_690_oauth_access"
    "test_issue_690_oauth_v2_access"
    "test_send"
    "test_send_attachments"
    "test_send_blocks"
    "test_send_dict"
  ];

  pythonImportsCheck = [
    "slack"
  ];

  meta = with lib; {
    description = "A client for Slack, which supports the Slack Web API and Real Time Messaging (RTM) API";
    homepage = "https://github.com/slackapi/python-slackclient";
    changelog = "https://github.com/slackapi/python-slack-sdk/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ flokli psyanticy ];
  };
}