Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ If you make changes to `slack_bolt/adapter/*`, please verify if it surely works

```sh
# Install all optional dependencies
$ pip install -r requirements/adapter.txt
$ pip install -r requirements/adapter_testing.txt
$ pip install -r requirements/adapter_dev.txt
$ pip install -r requirements/test_adapter.txt

# Set required env variables
$ export SLACK_SIGNING_SECRET=***
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
run: |
pip install -U pip
pip install -U .
pip install -r requirements/tools.txt
pip install -r requirements/dev_tools.txt
- name: Type check synchronous modules
run: mypy --config-file pyproject.toml --exclude "async_|/adapter/"
- name: Install async and adapter dependencies
run: |
pip install -r requirements/async.txt
pip install -r requirements/adapter.txt
pip install -r requirements/async_dev.txt
pip install -r requirements/adapter_dev.txt
- name: Type check all modules
run: mypy --config-file pyproject.toml

Expand Down Expand Up @@ -88,15 +88,15 @@ jobs:
run: |
pip install -U pip
pip install .
pip install -r requirements/testing_without_asyncio.txt
pip install -r requirements/test.txt
- name: Run tests without aiohttp
run: |
pytest tests/slack_bolt/ --junitxml=reports/test_slack_bolt.xml
pytest tests/scenario_tests/ --junitxml=reports/test_scenario.xml
- name: Install adapter dependencies
run: |
pip install -r requirements/adapter.txt
pip install -r requirements/adapter_testing.txt
pip install -r requirements/adapter_dev.txt
pip install -r requirements/test_adapter.txt
- name: Run tests for HTTP Mode adapters
run: |
pytest tests/adapter_tests/ \
Expand All @@ -105,14 +105,14 @@ jobs:
--junitxml=reports/test_adapter.xml
- name: Install async dependencies
run: |
pip install -r requirements/async.txt
pip install -r requirements/async_dev.txt
- name: Run tests for Socket Mode adapters
run: |
# Requires async test dependencies
pytest tests/adapter_tests/socket_mode/ --junitxml=reports/test_adapter_socket_mode.xml
- name: Install all dependencies
run: |
pip install -r requirements/testing.txt
pip install -r requirements/test_async.txt
- name: Run tests for HTTP Mode adapters (ASGI)
run: |
# Requires async test dependencies
Expand Down Expand Up @@ -155,9 +155,9 @@ jobs:
run: |
pip install -U pip
pip install .
pip install -r requirements/adapter.txt
pip install -r requirements/testing.txt
pip install -r requirements/adapter_testing.txt
pip install -r requirements/adapter_dev.txt
pip install -r requirements/test_async.txt
pip install -r requirements/test_adapter.txt
- name: Run all tests for codecov
run: |
pytest --cov=./slack_bolt/ --cov-report=xml
Expand Down
14 changes: 7 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Then wire it into `BoltContext` (`slack_bolt/context/context.py`) and `AsyncBolt
1. Create `slack_bolt/adapter/<framework>/`
2. Add `__init__.py` and `handler.py` (or `async_handler.py` for async frameworks)
3. The handler converts the framework's request to `BoltRequest`, calls `app.dispatch()`, and converts `BoltResponse` back
4. Add the framework to `requirements/adapter.txt` with version constraints
4. Add the framework to `requirements/adapter_dev.txt` with version constraints
5. Add adapter tests in `tests/adapter_tests/` (sync) or `tests/adapter_tests_async/` (async)

### Adding a Kwargs-Injectable Argument
Expand All @@ -205,12 +205,12 @@ The core package has a **single required runtime dependency**: `slack_sdk` (defi

**`requirements/` directory structure:**

- `async.txt` -- async runtime deps (`aiohttp`, `websockets`)
- `adapter.txt` -- all framework adapter deps (Flask, Django, FastAPI, etc.)
- `testing.txt` -- test runner deps (`pytest`, `pytest-asyncio`, includes `async.txt`)
- `testing_without_asyncio.txt` -- test deps without async (`pytest`, `pytest-cov`)
- `adapter_testing.txt` -- adapter-specific test deps (`moto`, `boddle`, `sanic-testing`)
- `tools.txt` -- dev tools (`mypy`, `flake8`, `black`)
- `async_dev.txt` -- async runtime deps (`aiohttp`, `websockets`)
- `adapter_dev.txt` -- all framework adapter deps (Flask, Django, FastAPI, etc.)
- `test_async.txt` -- test runner deps (`pytest`, `pytest-asyncio`, includes `async_dev.txt`)
- `test.txt` -- test deps without async (`pytest`, `pytest-cov`)
- `test_adapter.txt` -- adapter-specific test deps (`moto`, `boddle`, `sanic-testing`)
- `dev_tools.txt` -- dev tools (`mypy`, `flake8`, `black`)

When adding a new dependency: add it to the appropriate `requirements/*.txt` file with version constraints, never to `pyproject.toml` `dependencies` (unless it's a core runtime dep, which is very rare).

Expand Down
4 changes: 2 additions & 2 deletions requirements/adapter.txt → requirements/adapter_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pip install -r requirements/adapter.txt
# NOTE: any of async ones requires pip install -r requirements/async.txt too
# pip install -r requirements/adapter_dev.txt
# NOTE: any of async ones requires pip install -r requirements/async_dev.txt too
# used only under slack_bolt/adapter
boto3<=2
bottle>=0.12,<1
Expand Down
3 changes: 0 additions & 3 deletions requirements/async.txt

This file was deleted.

3 changes: 3 additions & 0 deletions requirements/async_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pip install -r requirements/async_dev.txt
aiohttp>=3,<4
websockets<16
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# pip install -r requirements/testing_without_asyncio.txt
# pip install -r requirements/test.txt
pytest<8.5
pytest-cov>=7.1.0,<8; python_version>="3.14" # only needed to evaluate coverage on the latest supported python version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pip install -r requirements/adapter_testing.txt
# pip install -r requirements/test_adapter.txt
moto>=3,<6 # For AWS tests
docker>=5,<8 # Used by moto
boddle>=0.2.9,<0.3 # For Bottle app tests
Expand Down
4 changes: 4 additions & 0 deletions requirements/test_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# pip install -r requirements/test_async.txt
-r test.txt
-r async_dev.txt
pytest-asyncio<2;
4 changes: 0 additions & 4 deletions requirements/testing.txt

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd ${script_dir}/..
if [[ "$1" != "--no-install" ]]; then
export PIP_REQUIRE_VIRTUALENV=1
pip install -U pip
pip install -U -r requirements/tools.txt
pip install -U -r requirements/dev_tools.txt
fi

black slack_bolt/ tests/
4 changes: 2 additions & 2 deletions scripts/generate_api_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ script_dir=$(dirname "$0")
cd "${script_dir}/.."

pip install -U pip
pip install -U -r requirements/adapter.txt
pip install -U -r requirements/async.txt
pip install -U -r requirements/adapter_dev.txt
pip install -U -r requirements/async_dev.txt
pip install -U pdoc3
pip install .
rm -rf docs/reference
Expand Down
8 changes: 4 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ pip install -U pip
pip uninstall python-lambda

pip install -U -e .
pip install -U -r requirements/testing.txt
pip install -U -r requirements/adapter.txt
pip install -U -r requirements/adapter_testing.txt
pip install -U -r requirements/tools.txt
pip install -U -r requirements/test_async.txt
pip install -U -r requirements/adapter_dev.txt
pip install -U -r requirements/test_adapter.txt
pip install -U -r requirements/dev_tools.txt

# To avoid errors due to the old versions of click forced by Chalice
pip install -U pip click
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd ${script_dir}/..

if [[ "$1" != "--no-install" ]]; then
pip install -U pip
pip install -U -r requirements/tools.txt
pip install -U -r requirements/dev_tools.txt
fi

flake8 slack_bolt/ && flake8 examples/
6 changes: 3 additions & 3 deletions scripts/run_mypy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ cd ${script_dir}/..
if [[ "$1" != "--no-install" ]]; then
pip install -U pip
pip install -U .
pip install -U -r requirements/async.txt
pip install -U -r requirements/adapter.txt
pip install -U -r requirements/tools.txt
pip install -U -r requirements/async_dev.txt
pip install -U -r requirements/adapter_dev.txt
pip install -U -r requirements/dev_tools.txt
fi

mypy --config-file pyproject.toml