From 371a83f20fc438dc5ece21739f0875e86a2e8170 Mon Sep 17 00:00:00 2001 From: Ivan Larin Date: Mon, 22 Oct 2018 19:46:55 +0300 Subject: [PATCH 1/4] Depend on marshmallow>=3.0.0b7 kennethreitz/responder#119 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e92701b..49a8d54 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ required = [ "python-multipart", "chardet", "apispec>=1.0.0b1", - "marshmallow", + "marshmallow>=3.0.0b7", "asgiref", "docopt", "itsdangerous", From 2c9e6572c58a6e9916385675683d26b864b88104 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 22 Oct 2018 17:05:50 -0400 Subject: [PATCH 2/4] Update tour.rst --- docs/source/tour.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tour.rst b/docs/source/tour.rst index 089908a..b7462bb 100644 --- a/docs/source/tour.rst +++ b/docs/source/tour.rst @@ -185,7 +185,7 @@ WebSocket Support Responder supports WebSockets:: - @api.ws_route('/ws') + @api.route('/ws', websocket=True) async def hello(ws): await ws.accept() await ws.send_text("Hello via websocket!") From 60f0e765c2e3d960bdb8b3b441e030c4bf1d4d9d Mon Sep 17 00:00:00 2001 From: Taoufik Date: Mon, 22 Oct 2018 22:14:18 +0100 Subject: [PATCH 3/4] Quick fix --- responder/routes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/responder/routes.py b/responder/routes.py index b672109..9dbc723 100644 --- a/responder/routes.py +++ b/responder/routes.py @@ -79,6 +79,7 @@ class Route: def is_class_based(self): return hasattr(self.endpoint, "__class__") + @property def is_function(self): routed = hasattr(self.endpoint, "is_routed") code = hasattr(self.endpoint, "__code__") From 071d34b0161c92df499ecfc891884a5fe1eee6d3 Mon Sep 17 00:00:00 2001 From: Andy Dai Date: Tue, 23 Oct 2018 17:07:42 +0800 Subject: [PATCH 4/4] Fix Route.is_function --- .gitignore | 2 +- responder/routes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5813b6e..d6482b4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ coverage.xml __pycache__ tests/__pycache__ - +*.pyc build responder.egg-info/ dist/ diff --git a/responder/routes.py b/responder/routes.py index 9dbc723..f444e31 100644 --- a/responder/routes.py +++ b/responder/routes.py @@ -81,7 +81,7 @@ class Route: @property def is_function(self): - routed = hasattr(self.endpoint, "is_routed") + is_callable = callable(self.endpoint) code = hasattr(self.endpoint, "__code__") kwdefaults = hasattr(self.endpoint, "__kwdefaults__") - return all((routed, code, kwdefaults)) + return all((is_callable, code, kwdefaults))