Skip to content

Commit

Permalink
Migrate to slack_sdk 3.0.0a5 and fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Sep 18, 2020
1 parent 2eb0925 commit d1dc479
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
4 changes: 4 additions & 0 deletions scripts/build_pypi_package.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

script_dir=`dirname $0`
cd ${script_dir}/..
rm -rf ./slack_bolt.egg-info

pip install -U pip && \
python setup.py test && \
pip install twine wheel && \
Expand Down
4 changes: 4 additions & 0 deletions scripts/deploy_to_prod_pypi_org.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

script_dir=`dirname $0`
cd ${script_dir}/..
rm -rf ./slack_bolt.egg-info

pip install -U pip && \
python setup.py test && \
pip install twine wheel && \
Expand Down
4 changes: 4 additions & 0 deletions scripts/deploy_to_test_pypi_org.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

script_dir=`dirname $0`
cd ${script_dir}/..
rm -rf ./slack_bolt.egg-info

pip install -U pip && \
python setup.py test && \
pip install twine wheel && \
Expand Down
1 change: 1 addition & 0 deletions scripts/install_all_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

script_dir=`dirname $0`
cd ${script_dir}/..
rm -rf ./slack_bolt.egg-info

test_target="$1"

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
exclude=["samples", "integration_tests", "tests", "tests.*",]
),
include_package_data=True, # MANIFEST.in
install_requires=["slack_sdk==3.0.0a4",],
install_requires=["slack_sdk>=3.0.0a5",],
setup_requires=["pytest-runner==5.2"],
tests_require=test_dependencies,
test_suite="tests",
Expand Down
3 changes: 1 addition & 2 deletions slack_bolt/oauth/async_oauth_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,12 @@ def __init__(
cookie_name=self.state_cookie_name,
expiration_seconds=self.state_expiration_seconds,
)
# TODO: add authorization_url support on the slack-sdk side
self.authorize_url_generator = AuthorizeUrlGenerator(
client_id=self.client_id,
client_secret=self.client_secret,
redirect_uri=self.redirect_uri,
scopes=self.scopes,
user_scopes=self.user_scopes,
authorization_url=self.authorization_url,
)
self.redirect_uri_page_renderer = RedirectUriPageRenderer(
install_path=self.install_path,
Expand Down
3 changes: 1 addition & 2 deletions slack_bolt/oauth/oauth_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,12 @@ def __init__(
cookie_name=self.state_cookie_name,
expiration_seconds=self.state_expiration_seconds,
)
# TODO: add authorization_url support on the slack-sdk side
self.authorize_url_generator = AuthorizeUrlGenerator(
client_id=self.client_id,
client_secret=self.client_secret,
redirect_uri=self.redirect_uri,
scopes=self.scopes,
user_scopes=self.user_scopes,
authorization_url=self.authorization_url,
)
self.redirect_uri_page_renderer = RedirectUriPageRenderer(
install_path=self.install_path,
Expand Down
21 changes: 13 additions & 8 deletions tests/adapter_tests/test_aws_chalice.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,19 @@ def say_it(say):
headers["x-slack-bolt-lazy-function-name"] = "say_it"

request: Request = Request(
method="NONE",
query_params={},
uri_params={},
context={},
stage_vars=None,
is_base64_encoded=False,
body=body,
headers=headers,
{
"requestContext": {
"httpMethod": "NONE",
"resourcePath": "/slack/events",
},
"multiValueQueryStringParameters": {},
"pathParameters": {},
"context": {},
"stageVariables": None,
"isBase64Encoded": False,
"body": body,
"headers": headers,
}
)
response: Response = slack_handler.handle(request)
assert response.status_code == 200
Expand Down

0 comments on commit d1dc479

Please sign in to comment.