From 8913d572314505d4df7997384df4b7fb1a3aa919 Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Mon, 4 Mar 2024 13:27:59 -0600 Subject: [PATCH 1/3] Remove run-time dependency on asgiref --- setup.cfg | 2 +- shiny/_autoreload.py | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2658862b0..64e8631f4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,7 +47,6 @@ install_requires = mdit-py-plugins>=0.3.0 linkify-it-py>=1.0 appdirs>=1.4.4 - asgiref>=3.5.2 watchfiles>=0.18.0;platform_system!="Emscripten" questionary>=2.0.0;platform_system!="Emscripten" # This is needed to address a DoS issue. In the future, when we are able to upgrade @@ -99,6 +98,7 @@ dev = pyright>=1.1.348 pre-commit>=2.15.0 wheel + asgiref>=3.5.2 matplotlib pandas pandas-stubs diff --git a/shiny/_autoreload.py b/shiny/_autoreload.py index 255ceb9ab..b9c3646dd 100644 --- a/shiny/_autoreload.py +++ b/shiny/_autoreload.py @@ -8,17 +8,18 @@ import secrets import threading import webbrowser -from typing import Callable, Optional, cast - -import starlette.types -from asgiref.typing import ( - ASGI3Application, - ASGIReceiveCallable, - ASGISendCallable, - ASGISendEvent, - HTTPResponseStartEvent, - Scope, -) +from typing import TYPE_CHECKING, Callable, Optional, cast + +if TYPE_CHECKING: + import starlette.types + from asgiref.typing import ( + ASGI3Application, + ASGIReceiveCallable, + ASGISendCallable, + ASGISendEvent, + HTTPResponseStartEvent, + Scope, + ) from ._hostenv import get_proxy_url From c2c739d108b10111776412357e3b9861b7e08014 Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Mon, 4 Mar 2024 13:35:48 -0600 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e74514d8..9a3f6fe95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] - YYYY-MM-DD +### Breaking Changes + +### New features + +### Bug fixes + +### Other changes + +* Closed #1178: Removed run-time dependency on asgiref. (#1183) ## [0.8.0] - 2024-03-04 From fca472f2f0f4b9d5750642171a62dff89810c841 Mon Sep 17 00:00:00 2001 From: Winston Chang Date: Mon, 4 Mar 2024 15:36:40 -0600 Subject: [PATCH 3/3] Move asgiref back into required --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 64e8631f4..2658862b0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,6 +47,7 @@ install_requires = mdit-py-plugins>=0.3.0 linkify-it-py>=1.0 appdirs>=1.4.4 + asgiref>=3.5.2 watchfiles>=0.18.0;platform_system!="Emscripten" questionary>=2.0.0;platform_system!="Emscripten" # This is needed to address a DoS issue. In the future, when we are able to upgrade @@ -98,7 +99,6 @@ dev = pyright>=1.1.348 pre-commit>=2.15.0 wheel - asgiref>=3.5.2 matplotlib pandas pandas-stubs