Skip to content

Commit

Permalink
Remove starlette import from asgi module (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
eirsyl authored Jan 30, 2024
1 parent 85dff18 commit 3c6911e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "troncos"
version = "4.4.0"
version = "4.4.1"
description = "Collection of Python logging, tracing and profiling tools"
authors = [
"Guðmundur Björn Birkisson <gudmundur.birkisson@oda.com>",
Expand Down
9 changes: 8 additions & 1 deletion troncos/contrib/asgi/logging/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import ddtrace
from python_ipware.python_ipware import IpWare
from starlette.types import ASGIApp

try:
from structlog import get_logger
Expand All @@ -12,6 +11,14 @@
"Structlog must be installed to use the asgi logging middleware."
)

Scope = MutableMapping[str, Any]
Message = MutableMapping[str, Any]

Receive = Callable[[], Awaitable[Message]]
Send = Callable[[Message], Awaitable[None]]

ASGIApp = Callable[[Scope, Receive, Send], Awaitable[None]]


class Headers(Mapping[str, str]):
"""
Expand Down

0 comments on commit 3c6911e

Please sign in to comment.