Skip to content

Commit 9f4b735

Browse files
committed
Update maintainers guide
1 parent 27d8d3b commit 9f4b735

File tree

9 files changed

+108
-23
lines changed

9 files changed

+108
-23
lines changed

maintainers_guide.md

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,77 @@
1-
# Deploy to test repository
1+
# Getting Started with The Project
22

3+
## Python Runtime Management
4+
5+
We recommend using pyenv for Python runtime management.
6+
7+
https://github.com/pyenv/pyenv
8+
9+
If you use macOS, follow the following steps:
10+
11+
```bash
12+
$ brew update
13+
$ brew install pyenv
14+
```
15+
16+
Then, install Python runtimes for this project:
17+
18+
```bash
19+
$ pyenv install -l | grep -v "-e[conda|stackless|pypy]"
20+
21+
$ pyenv install 3.8.5
22+
$ pyenv local 3.8.5
23+
24+
$ pyenv versions
25+
system
26+
3.6.10
27+
3.7.7
28+
* 3.8.5 (set by /path-to-bolt-python/.python-version)
29+
30+
$ pyenv rehash
31+
```
32+
33+
## Create a Virtual Environment
34+
35+
```
36+
$ python -m venv env_3.8.5
37+
$ source env_3.8.5/bin/activate
338
```
4-
# https://packaging.python.org/guides/using-testpypi/
5-
python -m venv env
6-
source env/bin/activate
7-
pip install --upgrade pip
8-
pip install twine wheel
9-
rm -rf dist/ build/ slack_bolt.egg-info/ && python setup.py sdist bdist_wheel
10-
twine check dist/*
1139

12-
# Deploy to test repository
13-
twine upload --repository testpypi dist/*
14-
# Test installation
15-
pip install -U --index-url https://test.pypi.org/simple/ slack_bolt
40+
## Run All the Tests
41+
42+
```bash
43+
$ pip install -U pip
44+
$ python setup.py test # or ./scripts/run_tests.sh
45+
```
46+
47+
# Run the Samples
48+
49+
```bash
50+
# Install all optional dependencies
51+
$ pip install -e ".[adapter]"
52+
53+
$ cd samples/
54+
$ export SLACK_SIGNING_SECRET=***
55+
$ export SLACK_BOT_TOKEN=xoxb-***
56+
$ python app.py
57+
58+
# In another terminal
59+
$ ngrok http 3000 --subdomain {your-domain}
60+
```
61+
62+
# Deploying to test.pypi.org
63+
64+
## $HOME/.pypirc
65+
66+
```
67+
[testpypi]
68+
username: {your username}
69+
password: {your password}
70+
```
71+
72+
## Run the Script
73+
74+
```bash
75+
$ echo '__version__ = "{the version}"' > slack_bolt/version.py
76+
$ ./scripts/deploy_to_test_pypi_org.sh
1677
```

scripts/build_pypi_package.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
./scripts/run_tests.sh && \
4+
pip install -U pip && \
5+
pip install twine wheel && \
6+
rm -rf dist/ build/ slack_bolt.egg-info/ && \
7+
python setup.py sdist bdist_wheel && \
8+
twine check dist/*

scripts/deploy_to_test_pypi_org.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
./scripts/run_tests.sh && \
4+
pip install -U pip && \
5+
pip install twine wheel && \
6+
rm -rf dist/ build/ slack_bolt.egg-info/ && \
7+
python setup.py sdist bdist_wheel && \
8+
twine check dist/* && \
9+
twine upload --repository testpypi dist/*

scripts/run_tests.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
script_dir=`dirname $0`
77
cd ${script_dir}/..
88

9-
python setup.py install && \
10-
pip install "black==19.10b0" && \
9+
pip install -e ".[testing]" && \
1110
black slack_bolt/ tests/ && \
12-
pytest $1
11+
pytest $1

scripts/uninstall_all.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
pip freeze | grep -v "^-e" | xargs pip uninstall -y

slack_bolt/adapter/aws_lambda/chalice_handler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def clear_all_log_handlers(cls):
2525
root.removeHandler(handler)
2626

2727
def handle(self, request: Request):
28-
body: str = request.raw_body.decode(
29-
"utf-8"
30-
) if request.raw_body else ""
28+
body: str = request.raw_body.decode("utf-8") if request.raw_body else ""
3129
self.logger.debug(f"Incoming request: {request.to_dict()}, body: {body}")
3230

3331
method = request.method
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Don't add async module imports here
2-
from .handler import SlackRequestHandler
2+
from .handler import SlackRequestHandler

slack_bolt/app/async_server.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ def __init__(
1717
if self._bolt_oauth_flow:
1818
self.web_app.add_routes(
1919
[
20-
web.get(self._bolt_oauth_flow.install_path, self.handle_get_requests),
21-
web.get(self._bolt_oauth_flow.redirect_uri_path, self.handle_get_requests),
20+
web.get(
21+
self._bolt_oauth_flow.install_path, self.handle_get_requests
22+
),
23+
web.get(
24+
self._bolt_oauth_flow.redirect_uri_path,
25+
self.handle_get_requests,
26+
),
2227
web.post(self._endpoint_path, self.handle_post_requests),
2328
]
2429
)
2530
else:
26-
self.web_app.add_routes([web.post(self._endpoint_path, self.handle_post_requests)])
31+
self.web_app.add_routes(
32+
[web.post(self._endpoint_path, self.handle_post_requests)]
33+
)
2734

2835
async def handle_get_requests(self, request: web.Request) -> web.Response:
2936
oauth_flow = self._bolt_oauth_flow

slack_bolt/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.0a6"
1+
__version__ = "0.2.0a7"

0 commit comments

Comments
 (0)