Skip to content

Commit

Permalink
Merge pull request bocadilloproject#60 from bocadilloproject/refactor…
Browse files Browse the repository at this point in the history
…/wsgi

Remove dependency on asgiref
  • Loading branch information
florimondmanca authored Dec 15, 2018
2 parents 942a01e + 3330d43 commit f05f468
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Bocadillo adheres to [Semantic Versioning](https://semver.org).
### Removed

- Removed example application.
- Removed dependency on `asgiref` for WSGI sub-apps.

## [v0.7.0]

Expand Down
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name = "pypi"
starlette = "*"
uvicorn = "*"
parse = "*"
asgiref = "*"
"jinja2" = "*"
whitenoise = "*"
requests = "*"
Expand Down
49 changes: 17 additions & 32 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bocadillo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from functools import partial
from typing import Any, Dict, List, Optional, Tuple, Type, Union

from asgiref.wsgi import WsgiToAsgi
from starlette.middleware.cors import CORSMiddleware
from starlette.middleware.gzip import GZipMiddleware
from starlette.middleware.httpsredirect import HTTPSRedirectMiddleware
from starlette.middleware.trustedhost import TrustedHostMiddleware
from starlette.middleware.wsgi import WSGIResponder
from starlette.testclient import TestClient
from uvicorn.main import get_logger, run
from uvicorn.reloaders.statreload import StatReload
Expand Down Expand Up @@ -350,8 +350,7 @@ def find_app(self, scope: dict) -> ASGIAppInstance:
try:
return app(scope)
except TypeError:
app = WsgiToAsgi(app)
return app(scope)
return WSGIResponder(app, scope)

def app(s: dict):
async def asgi(receive, send):
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"starlette",
"uvicorn",
"jinja2",
"asgiref",
"whitenoise",
"requests",
"parse",
Expand Down

0 comments on commit f05f468

Please sign in to comment.