From 18019b4677e6f20ca6e5b940bafc878f702986b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:36:05 +0100 Subject: [PATCH] Drop starsessions from App's requirements (#18470) --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> Co-authored-by: Jirka Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit 369b9902224d159f3ffaa1f5155b5f5b364a534a) --- requirements/app/app.txt | 1 - src/lightning/app/core/api.py | 12 ------------ src/lightning/app/utilities/imports.py | 4 ---- 3 files changed, 17 deletions(-) diff --git a/requirements/app/app.txt b/requirements/app/app.txt index 06c52cd21b339..c55611ede9fa6 100644 --- a/requirements/app/app.txt +++ b/requirements/app/app.txt @@ -2,7 +2,6 @@ lightning-cloud == 0.5.57 # Must be pinned to ensure compatibility packaging typing-extensions >=4.0.0, <4.8.0 deepdiff >=5.7.0, <6.6.0 -starsessions >=1.2.1, <2.0 # strict fsspec[http] >=2022.5.0, <2023.11.0 croniter >=1.3.0, <1.5.0 # strict; TODO: for now until we find something more robust. traitlets >=5.3.0, <5.10.0 diff --git a/src/lightning/app/core/api.py b/src/lightning/app/core/api.py index 11205ec7e894e..5f50c6faa0a2b 100644 --- a/src/lightning/app/core/api.py +++ b/src/lightning/app/core/api.py @@ -58,15 +58,6 @@ from lightning.app.utilities.cloud import is_running_in_cloud from lightning.app.utilities.component import _context from lightning.app.utilities.enum import ComponentContext, OpenAPITags -from lightning.app.utilities.imports import _is_starsessions_available - -if _is_starsessions_available(): - from starsessions import SessionMiddleware -else: - - class SessionMiddleware: # type: ignore[no-redef] - pass - # TODO: fixed uuid for now, it will come from the FastAPI session TEST_SESSION_UUID = "1234" @@ -175,9 +166,6 @@ class StateUpdate(BaseModel): allow_headers=["*"], ) -if _is_starsessions_available(): - fastapi_service.add_middleware(SessionMiddleware, secret_key="secret", autoload=True) # noqa: S106 - # General sequence is: # * an update is generated in the UI diff --git a/src/lightning/app/utilities/imports.py b/src/lightning/app/utilities/imports.py index bc5e4ef4c676e..33d6c259e09b5 100644 --- a/src/lightning/app/utilities/imports.py +++ b/src/lightning/app/utilities/imports.py @@ -103,10 +103,6 @@ def _is_streamlit_tensorboard_available() -> bool: return module_available("streamlit_tensorboard") -def _is_starsessions_available() -> bool: - return module_available("starsessions") - - def _is_gradio_available() -> bool: return module_available("gradio")