diff --git a/src/lightning/__setup__.py b/src/lightning/__setup__.py index 2d3bb0e7d1f33..71c24aefd39d8 100644 --- a/src/lightning/__setup__.py +++ b/src/lightning/__setup__.py @@ -98,7 +98,6 @@ def _setup_args() -> dict[str, Any]: "entry_points": { "console_scripts": [ "fabric = lightning.fabric.cli:_main", - "lightning = lightning.fabric.cli:_legacy_main", ], }, "setup_requires": [], diff --git a/src/lightning/fabric/CHANGELOG.md b/src/lightning/fabric/CHANGELOG.md index 7e401aff67671..c8e87416b1bc7 100644 --- a/src/lightning/fabric/CHANGELOG.md +++ b/src/lightning/fabric/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +## [unreleased] - YYYY-MM-DD + +### Removed + +Removed legacy supoport for `lightning run model`. Use `fabric run` instead. ([#20588](https://github.com/Lightning-AI/pytorch-lightning/pull/20588)) + ## [2.5.0] - 2024-12-19 ### Added diff --git a/src/lightning/fabric/cli.py b/src/lightning/fabric/cli.py index 5f18884e83d79..2268614abb97b 100644 --- a/src/lightning/fabric/cli.py +++ b/src/lightning/fabric/cli.py @@ -14,8 +14,6 @@ import logging import os import re -import subprocess -import sys from argparse import Namespace from typing import Any, Optional @@ -50,25 +48,6 @@ def _get_supported_strategies() -> list[str]: if _CLICK_AVAILABLE: import click - def _legacy_main() -> None: - """Legacy CLI handler for fabric. - - Raises deprecation warning and runs through fabric cli if necessary, else runs the entrypoint directly - - """ - hparams = sys.argv[1:] - if len(hparams) >= 2 and hparams[0] == "run" and hparams[1] == "model": - print( - "`lightning run model` is deprecated and will be removed in future versions." - " Please call `fabric run` instead." - ) - _main() - return - - if _LIGHTNING_SDK_AVAILABLE: - subprocess.run([sys.executable, "-m", "lightning_sdk.cli.entrypoint"] + hparams) - return - @click.group() def _main() -> None: pass diff --git a/tests/tests_fabric/test_cli.py b/tests/tests_fabric/test_cli.py index ec3160111e6ee..944584114184b 100644 --- a/tests/tests_fabric/test_cli.py +++ b/tests/tests_fabric/test_cli.py @@ -179,18 +179,6 @@ def test_run_through_fabric_entry_point(): assert message in result.stdout or message in result.stderr -@pytest.mark.skipif("lightning.fabric" == "lightning_fabric", reason="standalone package") -def test_run_through_lightning_entry_point(): - result = subprocess.run("lightning run model --help", capture_output=True, text=True, shell=True) - - deprecation_message = ( - "`lightning run model` is deprecated and will be removed in future versions. Please call `fabric run` instead" - ) - message = "Usage: lightning run [OPTIONS] SCRIPT [SCRIPT_ARGS]" - assert deprecation_message in result.stdout - assert message in result.stdout or message in result.stderr - - @mock.patch("lightning.fabric.cli._process_cli_args") @mock.patch("lightning.fabric.cli._load_distributed_checkpoint") @mock.patch("lightning.fabric.cli.torch.save")