Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ python -m venv .venv
source .venv/bin/activate

pip install -U pip
# aiohttp is required
pip install slack_bolt aiohttp
pip install "slack_bolt[async]"
```

In async apps, all middleware/listeners must be async functions. When calling utility methods (like `ack` and `say`) within these functions, it's required to use the `await` keyword.
Expand Down
4 changes: 2 additions & 2 deletions docs/english/concepts/async.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Using async (asyncio)

To use the async version of Bolt, you can import and initialize an `AsyncApp` instance (rather than `App`). `AsyncApp` relies on [AIOHTTP](https://docs.aiohttp.org) to make API requests, which means you'll need to install `aiohttp` (by adding to `requirements.txt` or running `pip install aiohttp`).
To use the async version of Bolt, you can import and initialize an `AsyncApp` instance (rather than `App`). `AsyncApp` relies on [AIOHTTP](https://docs.aiohttp.org) to make API requests, which means you'll need to install the async extras (by running `pip install "slack-bolt[async]"`).

Sample async projects can be found within the repository's [examples](https://github.com/slackapi/bolt-python/tree/main/examples) folder.

```python
# Requirement: install aiohttp
# Requirement: pip install "slack-bolt[async]"
from slack_bolt.async_app import AsyncApp
app = AsyncApp()

Expand Down
4 changes: 2 additions & 2 deletions docs/japanese/concepts/async.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Async(asyncio)の使用

非同期バージョンの Bolt を使用する場合は、`App` の代わりに `AsyncApp` インスタンスをインポートして初期化します。`AsyncApp` では [AIOHTTP](https://docs.aiohttp.org/) を使って API リクエストを行うため、`aiohttp` をインストールする必要があります(`requirements.txt` に追記するか、`pip install aiohttp` を実行します)。
非同期バージョンの Bolt を使用する場合は、`App` の代わりに `AsyncApp` インスタンスをインポートして初期化します。`AsyncApp` では [AIOHTTP](https://docs.aiohttp.org/) を使って API リクエストを行うため、async extras のインストールが必要です(`pip install "slack-bolt[async]"` を実行します)。

非同期バージョンのプロジェクトのサンプルは、リポジトリの [`examples` フォルダ](https://github.com/slackapi/bolt-python/tree/main/examples)にあります。

```python
# aiohttp のインストールが必要です
# pip install "slack-bolt[async]" が必要です
from slack_bolt.async_app import AsyncApp
app = AsyncApp()

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "slack_bolt"
dynamic = ["version", "readme", "authors"]
dynamic = ["version", "readme", "authors", "optional-dependencies"]
description = "The Bolt Framework for Python"
license = { text = "MIT" }
classifiers = [
Expand Down Expand Up @@ -33,6 +33,7 @@ include = ["slack_bolt*"]
[tool.setuptools.dynamic]
version = { attr = "slack_bolt.version.__version__" }
readme = { file = ["README.md"], content-type = "text/markdown" }
optional-dependencies.async = { file = ["requirements/async.txt"] }

[tool.distutils.bdist_wheel]
universal = true
Expand Down
3 changes: 1 addition & 2 deletions slack_bolt/adapter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
"""Adapter modules for running Bolt apps along with Web frameworks or Socket Mode.
"""
"""Adapter modules for running Bolt apps along with Web frameworks or Socket Mode."""
3 changes: 1 addition & 2 deletions slack_bolt/async_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
source .venv/bin/activate

pip install -U pip
# aiohttp is required
pip install slack_bolt aiohttp
pip install "slack_bolt[async]"
```

In async apps, all middleware/listeners must be async functions. When calling utility methods (like `ack` and `say`) within these functions, it's required to use the `await` keyword.
Expand Down