Skip to content

Commit f068e54

Browse files
Use shared HAS_RICH constant in typer.core
1 parent 4c126f8 commit f068e54

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

typer/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
from click import Command, Group, Option
1111

1212
from . import __version__
13-
14-
HAS_RICH = importlib.util.find_spec("rich") is not None
13+
from .core import HAS_RICH
1514

1615
default_app_names = ("app", "cli", "main")
1716
default_func_names = ("main", "cli", "app")

typer/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .completion import get_completion_inspect_parameters
2323
from .core import (
2424
DEFAULT_MARKUP_MODE,
25+
HAS_RICH,
2526
MarkupMode,
2627
TyperArgument,
2728
TyperCommand,
@@ -50,9 +51,6 @@
5051
)
5152
from .utils import get_params_from_function
5253

53-
HAS_RICH = importlib.util.find_spec("rich") is not None
54-
55-
5654
_original_except_hook = sys.excepthook
5755
_typer_developer_exception_attr_name = "__typer_developer_exception__"
5856

0 commit comments

Comments
 (0)