From c18ccccb8e0744d8670433aeeba068c5654f32df Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sat, 4 Jun 2022 16:41:40 +0100 Subject: [PATCH] Run linter on examples --- examples/hello.py | 2 +- examples/hello_asgi.py | 11 +++++------ examples/hello_async.py | 6 +----- examples/hello_wsgi.py | 7 +++++-- tox.ini | 2 +- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/examples/hello.py b/examples/hello.py index 00cf7cd..fd16d58 100644 --- a/examples/hello.py +++ b/examples/hello.py @@ -1,4 +1,4 @@ -from microdot import Microdot, Response +from microdot import Microdot app = Microdot() diff --git a/examples/hello_asgi.py b/examples/hello_asgi.py index 39e1b01..02e1feb 100644 --- a/examples/hello_asgi.py +++ b/examples/hello_asgi.py @@ -1,8 +1,4 @@ -try: - import uasyncio as asyncio -except ImportError: - import asyncio -from microdot_asgi import Microdot, Response +from microdot_asgi import Microdot app = Microdot() @@ -34,4 +30,7 @@ async def shutdown(request): if __name__ == '__main__': - app.run(debug=True) + print('''Use an ASGI web server to run this applicaton. +Example: + uvicorn hello_asgi:app +''') diff --git a/examples/hello_async.py b/examples/hello_async.py index 1ef055d..c748830 100644 --- a/examples/hello_async.py +++ b/examples/hello_async.py @@ -1,8 +1,4 @@ -try: - import uasyncio as asyncio -except ImportError: - import asyncio -from microdot_asyncio import Microdot, Response +from microdot_asyncio import Microdot app = Microdot() diff --git a/examples/hello_wsgi.py b/examples/hello_wsgi.py index 54df02f..6f175bd 100644 --- a/examples/hello_wsgi.py +++ b/examples/hello_wsgi.py @@ -1,4 +1,4 @@ -from microdot_wsgi import Microdot, Response +from microdot_wsgi import Microdot app = Microdot() @@ -30,4 +30,7 @@ def shutdown(request): if __name__ == '__main__': - app.run(debug=True) + print('''Use a WSGI web server to run this applicaton. +Example: + gunicorn hello_wsgi:app +''') diff --git a/tox.ini b/tox.ini index 2229876..3816e71 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ deps= deps= flake8 commands= - flake8 --ignore=W503 --exclude tests/libs src tests + flake8 --ignore=W503 --exclude tests/libs src tests examples [testenv:upy] whitelist_externals=sh