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
2 changes: 1 addition & 1 deletion requirements/adapter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ chalice>=1.28,<2; python_version>"3.6"
CherryPy>=18,<19
Django>=3,<6
falcon>=2,<4; python_version<"3.11"
falcon>=3.1.1,<4; python_version>="3.11"
falcon>=3.1.1,<5; python_version>="3.11"
fastapi>=0.70.0,<1
Flask>=1,<4
Werkzeug>=2,<4
Expand Down
7 changes: 4 additions & 3 deletions slack_bolt/adapter/falcon/async_resource.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from datetime import datetime
from http import HTTPStatus

from falcon import version as falcon_version # type: ignore[import-untyped]
from falcon.asgi import Request, Response # type: ignore[import-untyped]
from falcon import version as falcon_version
from falcon.asgi import Request, Response
from slack_bolt import BoltResponse
from slack_bolt.async_app import AsyncApp
from slack_bolt.error import BoltError
Expand Down Expand Up @@ -41,7 +41,8 @@
return

resp.status = "404"
resp.body = "The page is not found..."
# Falcon 4.x w/ mypy fails to correctly infer the str type here
resp.body = "The page is not found..." # type: ignore[assignment]

Check warning on line 45 in slack_bolt/adapter/falcon/async_resource.py

View check run for this annotation

Codecov / codecov/patch

slack_bolt/adapter/falcon/async_resource.py#L45

Added line #L45 was not covered by tests

async def on_post(self, req: Request, resp: Response):
bolt_req = await self._to_bolt_request(req)
Expand Down
8 changes: 5 additions & 3 deletions slack_bolt/adapter/falcon/resource.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from http import HTTPStatus

from falcon import Request, Response, version as falcon_version # type: ignore[import-untyped]
from falcon import Request, Response, version as falcon_version

from slack_bolt import BoltResponse
from slack_bolt.app import App
Expand Down Expand Up @@ -35,7 +35,8 @@
return

resp.status = "404"
resp.body = "The page is not found..."
# Falcon 4.x w/ mypy fails to correctly infer the str type here
resp.body = "The page is not found..." # type: ignore[assignment]

Check warning on line 39 in slack_bolt/adapter/falcon/resource.py

View check run for this annotation

Codecov / codecov/patch

slack_bolt/adapter/falcon/resource.py#L39

Added line #L39 was not covered by tests

def on_post(self, req: Request, resp: Response):
bolt_req = self._to_bolt_request(req)
Expand All @@ -51,7 +52,8 @@

def _write_response(self, bolt_resp: BoltResponse, resp: Response):
if falcon_version.__version__.startswith("2."):
resp.body = bolt_resp.body
# Falcon 4.x w/ mypy fails to correctly infer the str type here
resp.body = bolt_resp.body # type: ignore[assignment]

Check warning on line 56 in slack_bolt/adapter/falcon/resource.py

View check run for this annotation

Codecov / codecov/patch

slack_bolt/adapter/falcon/resource.py#L56

Added line #L56 was not covered by tests
else:
resp.text = bolt_resp.body

Expand Down