diff --git a/src/lightning_app/CHANGELOG.md b/src/lightning_app/CHANGELOG.md index 13b3bc7684dfe..658e047f5f2a0 100644 --- a/src/lightning_app/CHANGELOG.md +++ b/src/lightning_app/CHANGELOG.md @@ -60,6 +60,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed the `enable_spawn` method of the `WorkRunExecutor` ([#15812](https://github.com/Lightning-AI/lightning/pull/15812) + - Fixed Sigterm Handler causing thread lock which caused KeyboardInterrupt to hang ([#15881](https://github.com/Lightning-AI/lightning/pull/15881)) - Fixed a bug where using `L.app.structures` would cause multiple apps to be opened and fail with an error in the cloud ([#15911](https://github.com/Lightning-AI/lightning/pull/15911)) @@ -68,6 +69,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed multiprocessing breakpoint ([#15950](https://github.com/Lightning-AI/lightning/pull/15950)) +- Fixed detection of a Lightning App running in debug mode ([#15951](https://github.com/Lightning-AI/lightning/pull/15951)) + + ## [1.8.3] - 2022-11-22 ### Changed diff --git a/src/lightning_app/core/app.py b/src/lightning_app/core/app.py index 2279956f7e118..d9389ecd27e24 100644 --- a/src/lightning_app/core/app.py +++ b/src/lightning_app/core/app.py @@ -93,12 +93,10 @@ def __init__( >>> from lightning_app.runners import MultiProcessRuntime >>> class RootFlow(LightningFlow): ... def run(self): - ... print("Hello World!") ... self._exit() ... >>> app = LightningApp(RootFlow()) # application can be dispatched using the `runners`. >>> MultiProcessRuntime(app).dispatch() - Hello World! """ self.root_path = root_path # when running behind a proxy diff --git a/src/lightning_app/utilities/app_helpers.py b/src/lightning_app/utilities/app_helpers.py index f07ae6bc88c1c..665c50889676c 100644 --- a/src/lightning_app/utilities/app_helpers.py +++ b/src/lightning_app/utilities/app_helpers.py @@ -511,14 +511,10 @@ def is_static_method(klass_or_instance, attr) -> bool: return isinstance(inspect.getattr_static(klass_or_instance, attr), staticmethod) -def _debugger_is_active() -> bool: - """Return if the debugger is currently active.""" - return hasattr(sys, "gettrace") and sys.gettrace() is not None - - def _should_dispatch_app() -> bool: return ( - _debugger_is_active() + __debug__ + and "_pytest.doctest" not in sys.modules and not bool(int(os.getenv("LIGHTNING_DISPATCHED", "0"))) and "LIGHTNING_APP_STATE_URL" not in os.environ )