fastapi/fastapi
Sebastián Ramírez 3f9f4a0f8f
Add dependencies with yield (used as context managers) (#595)
*  Add development/testing dependencies for Python 3.6

*  Add concurrency submodule with contextmanager_in_threadpool

*  Add AsyncExitStack to ASGI scope in FastAPI app call

*  Use async stack for contextmanager-able dependencies

including running in threadpool sync dependencies

*  Add tests for contextmanager dependencies

including internal raise checks when exceptions should be handled and when not

*  Add test for fake asynccontextmanager raiser

* 🐛 Fix mypy errors and coverage

* 🔇 Remove development logs and prints

*  Add tests for sub-contextmanagers, background tasks, and sync functions

* 🐛 Fix mypy errors for Python 3.7

* 💬 Fix error texts for clarity

* 📝 Add docs for dependencies with yield

*  Update SQL with SQLAlchemy tutorial to use dependencies with yield

and add an alternative with a middleware (from the old tutorial)

*  Update SQL tests to remove DB file during the same tests

*  Add tests for example with middleware

as a copy from the tests with dependencies with yield, removing the DB in the tests

* ✏️ Fix typos with suggestions from code review

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
2019-10-09 13:01:58 -05:00
..
dependencies Add dependencies with yield (used as context managers) (#595) 2019-10-09 13:01:58 -05:00
openapi Sort schemas alphabetically (#554) 2019-10-04 15:08:41 -05:00
security ♻️ Refine internal type declarations and logic around them (#338) 2019-06-27 20:51:17 +02:00
__init__.py 🔖 Release version 0.41.0 2019-10-07 06:44:07 -05:00
applications.py Add dependencies with yield (used as context managers) (#595) 2019-10-09 13:01:58 -05:00
concurrency.py Add dependencies with yield (used as context managers) (#595) 2019-10-09 13:01:58 -05:00
datastructures.py Add support for UploadFile class annotations (#63) 2019-03-03 20:52:37 +04:00
encoders.py ⬆️ Upgrade support to Pydantic version 0.32.2 (breaking change) (#463) 2019-08-30 19:30:03 -05:00
exception_handlers.py Separate Pydantic's ValidationError handler and improve docs for error handling (#273) 2019-05-29 16:27:55 +04:00
exceptions.py 🐛 Use proper import for Request -- fixes #492 (#493) 2019-09-01 07:51:42 -05:00
param_functions.py Implement dependency value cache per request (#292) 2019-06-05 21:00:54 +04:00
params.py Implement dependency value cache per request (#292) 2019-06-05 21:00:54 +04:00
py.typed add py.typed to ship typing information (#209) 2019-05-11 13:43:47 +04:00
routing.py Add better support for request body access/manipulation with custom classes (#589) 2019-10-04 19:23:34 -05:00
utils.py Add support for strings and __future__ type annotations (#451) 2019-09-29 16:19:09 -05:00