1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 slack-sdk,
11
12 # optional-dependencies
13 # - async
14 aiohttp,
15 websockets,
16 # - adapter
17 bottle,
18 chalice,
19 cherrypy,
20 django,
21 falcon,
22 fastapi,
23 flask,
24 gunicorn,
25 moto,
26 pyramid,
27 sanic,
28 sanic-testing,
29 starlette,
30 tornado,
31 uvicorn,
32 websocket-client,
33 werkzeug,
34
35 # tests
36 docker,
37 pytest-asyncio_0,
38 pytestCheckHook,
39 writableTmpDirAsHomeHook,
40}:
41
42buildPythonPackage rec {
43 pname = "slack-bolt";
44 version = "1.26.0";
45 pyproject = true;
46
47 src = fetchFromGitHub {
48 owner = "slackapi";
49 repo = "bolt-python";
50 tag = "v${version}";
51 hash = "sha256-5VbljuIYuPNPVZ6OwK9GV0ZyCNtMH7aPogOoBaaVb5A=";
52 };
53
54 build-system = [ setuptools ];
55
56 dependencies = [ slack-sdk ];
57
58 optional-dependencies = {
59 async = [
60 aiohttp
61 websockets
62 ];
63 adapter = [
64 bottle
65 chalice
66 cherrypy
67 django
68 falcon
69 fastapi
70 flask
71 gunicorn
72 moto
73 pyramid
74 sanic
75 sanic-testing
76 starlette
77 tornado
78 uvicorn
79 websocket-client
80 werkzeug
81 ];
82 };
83
84 pythonImportsCheck = [ "slack_bolt" ];
85
86 nativeCheckInputs = [
87 docker
88 pytest-asyncio_0
89 pytestCheckHook
90 writableTmpDirAsHomeHook
91 ]
92 ++ lib.flatten (builtins.attrValues optional-dependencies);
93
94 __darwinAllowLocalNetworking = true;
95
96 disabledTestPaths = [
97 # boddle is not packaged as of 2023-07-15
98 "tests/adapter_tests/bottle/"
99 ];
100
101 disabledTests = [
102 # Require network access
103 "test_failure"
104 # TypeError
105 "test_oauth"
106 ];
107
108 meta = {
109 description = "Framework to build Slack apps using Python";
110 homepage = "https://github.com/slackapi/bolt-python";
111 changelog = "https://github.com/slackapi/bolt-python/releases/tag/${src.tag}";
112 license = lib.licenses.mit;
113 maintainers = with lib.maintainers; [ samuela ];
114 };
115}