Abstract
aiocontextvars is required on Python 3.6 to make async integrations work (e.g. ASGI), but this is only obvious from reading the source code.
Technical Background
Here the aiocontextvars is optionally used under Python 3.6 to setup async-aware context vars. Without the package, async integrations just silently break (e.g. the ASGI integration misses a bunch of metadata, likely because under some conditions the current Hub/client is not found).
Potential Solutions
- log message: emit a message indicating the missing requirement (maybe only if the
debug=True flag is set)
- warning: same as previous point, but as a Python warning (not logging)
- optional requirement: add an optional requirement (like
async) that under Python 3.6 requires aiocontextvars here.
- docs: add a note to the integration docs
Refs
#289, #293
Abstract
aiocontextvarsis required on Python 3.6 to make async integrations work (e.g. ASGI), but this is only obvious from reading the source code.Technical Background
Here the
aiocontextvarsis optionally used under Python 3.6 to setup async-aware context vars. Without the package, async integrations just silently break (e.g. the ASGI integration misses a bunch of metadata, likely because under some conditions the current Hub/client is not found).Potential Solutions
debug=Trueflag is set)async) that under Python 3.6 requiresaiocontextvarshere.Refs
#289, #293