Skip to content

Commit 90467fb

Browse files
Configuring with pyproject.toml (#996)
* move configuration to pyproject.toml Co-authored-by: Kazuhiro Sera <[email protected]>
1 parent 9209e7b commit 90467fb

19 files changed

+139
-169
lines changed

.github/maintainers_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ If you make changes to `slack_bolt/adapter/*`, please verify if it surely works
7171

7272
```bash
7373
# Install all optional dependencies
74-
$ pip install -e ".[adapter]"
75-
$ pip install -e ".[adapter_testing]"
74+
$ pip install -r requirements/adapter.txt
75+
$ pip install -r requirements/adapter_testing.txt
7676

7777
# Set required env variables
7878
$ export SLACK_SIGNING_SECRET=***

.github/workflows/codecov.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
python-version: ${{ matrix.python-version }}
2727
- name: Install dependencies
2828
run: |
29-
python setup.py install
3029
pip install -U pip
31-
pip install -e ".[async]"
32-
pip install -e ".[adapter]"
33-
pip install -e ".[testing]"
34-
pip install -e ".[adapter_testing]"
30+
pip install .
31+
pip install -r requirements/async.txt
32+
pip install -r requirements/adapter.txt
33+
pip install -r requirements/testing.txt
34+
pip install -r requirements/adapter_testing.txt
3535
- name: Run all tests for codecov
3636
run: |
3737
pytest --cov=./slack_bolt/ --cov-report=xml

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
2727
run: |
28-
python setup.py install
2928
pip install -U pip
30-
pip install -e ".[testing_without_asyncio]"
29+
pip install -r requirements.txt
30+
pip install -r requirements/testing_without_asyncio.txt
3131
- name: Run tests without aiohttp
3232
run: |
3333
pytest tests/slack_bolt/
3434
pytest tests/scenario_tests/
3535
- name: Run tests for Socket Mode adapters
3636
run: |
37-
pip install -e ".[adapter]"
38-
pip install -e ".[adapter_testing]"
37+
pip install -r requirements/adapter.txt
38+
pip install -r requirements/adapter_testing.txt
3939
pytest tests/adapter_tests/socket_mode/
4040
- name: Run tests for HTTP Mode adapters (AWS)
4141
run: |
@@ -74,7 +74,7 @@ jobs:
7474
pytest tests/adapter_tests/tornado/
7575
- name: Run tests for HTTP Mode adapters (asyncio-based libraries)
7676
run: |
77-
pip install -e ".[async]"
77+
pip install -r requirements/async.txt
7878
# Falcon supports Python 3.11 since its v3.1.1
7979
pip install "falcon>=3.1.1,<4"
8080
pytest tests/adapter_tests_async/

pyproject.toml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,53 @@
1-
# black project prefers pyproject.toml
2-
# that's why we have this file in addition to other setting files
1+
[build-system]
2+
requires = ["setuptools", "pytest-runner==5.2", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "slack_bolt"
7+
dynamic = ["version", "readme", "dependencies"]
8+
description = "The Bolt Framework for Python"
9+
license = { text = "MIT" }
10+
authors = [{ name = "Slack Technologies, LLC", email = "[email protected]" }]
11+
classifiers = [
12+
"Programming Language :: Python :: 3.6",
13+
"Programming Language :: Python :: 3.7",
14+
"Programming Language :: Python :: 3.8",
15+
"Programming Language :: Python :: 3.9",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: Implementation :: CPython",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
]
23+
requires-python = ">=3.6"
24+
25+
26+
[project.urls]
27+
homepage = "https://github.com/slackapi/bolt-python"
28+
29+
[tool.setuptools.packages.find]
30+
include = ["slack_bolt*"]
31+
32+
[tool.setuptools.dynamic]
33+
version = { attr = "slack_bolt.version.__version__" }
34+
readme = { file = ["README.md"], content-type = "text/markdown" }
35+
dependencies = { file = ["requirements.txt"] }
36+
37+
[tool.distutils.bdist_wheel]
38+
universal = true
39+
340
[tool.black]
4-
line-length = 125
41+
line-length = 125
42+
43+
[tool.pytest.ini_options]
44+
testpaths = ["tests"]
45+
log_file = "logs/pytest.log"
46+
log_file_level = "DEBUG"
47+
log_format = "%(asctime)s %(levelname)s %(message)s"
48+
log_date_format = "%Y-%m-%d %H:%M:%S"
49+
filterwarnings = [
50+
"ignore:\"@coroutine\" decorator is deprecated since Python 3.8, use \"async def\" instead:DeprecationWarning",
51+
"ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning",
52+
]
53+
asyncio_mode = "auto"

pytest.ini

Lines changed: 0 additions & 9 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
slack_sdk>=3.25.0,<4

requirements/adapter.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# pip install -r requirements/adapter.txt
2+
# NOTE: any of async ones requires pip install -r requirements/async.txt too
3+
# used only under slack_bolt/adapter
4+
boto3<=2
5+
bottle>=0.12,<1
6+
chalice<=1.27.3; python_version=="3.6"
7+
chalice>=1.28,<2; python_version>"3.6"
8+
CherryPy>=18,<19
9+
Django>=3,<5
10+
falcon>=2,<4; python_version<"3.11"
11+
falcon>=3.1.1,<4; python_version>="3.11"
12+
fastapi>=0.70.0,<1
13+
Flask>=1,<3
14+
Werkzeug>=2,<3
15+
pyramid>=1,<3
16+
sanic>=20,<21; python_version=="3.6"
17+
sanic>=22,<23; python_version>"3.6"
18+
starlette>=0.14,<1
19+
tornado>=6,<7
20+
uvicorn<1 # The oldest version can vary among Python runtime versions
21+
gunicorn>=20,<21
22+
websocket_client>=1.2.3,<2 # Socket Mode 3rd party implementation

requirements/adapter_testing.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# pip install -r requirements/adapter_testing.txt
2+
moto>=3,<4 # For AWS tests
3+
docker>=5,<6 # Used by moto
4+
boddle>=0.2,<0.3 # For Bottle app tests
5+
Flask>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x
6+
Werkzeug>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x
7+
sanic-testing>=0.7; python_version>"3.6"
8+
requests>=2,<3 # For Starlette's TestClient

requirements/async.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# pip install -r requirements/async.txt
2+
aiohttp>=3,<4
3+
websockets>=8,<10; python_version=="3.6"
4+
websockets>=10,<11; python_version>"3.6"

requirements/testing.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# pip install -r requirements/testing.txt
2+
-r testing_without_asyncio.txt
3+
4+
pytest-asyncio>=0.16.0; python_version=="3.6"
5+
pytest-asyncio>=0.18.2,<1; python_version>"3.6"
6+
aiohttp>=3,<4

0 commit comments

Comments
 (0)