Skip to content

Commit 66ef8c9

Browse files
committed
fix #108
1 parent 1bc0198 commit 66ef8c9

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

django_typer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
model_parser_completer, # noqa: F401
4848
)
4949

50-
VERSION = (2, 2, 1)
50+
VERSION = (2, 2, 2)
5151

5252
__title__ = "Django Typer"
5353
__version__ = ".".join(str(i) for i in VERSION)

django_typer/management/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
patch.apply()
2525

2626
import typer # noqa: E402
27-
from typer.core import MarkupMode # noqa: E402
27+
import typer.core # noqa: E402
2828
from typer.core import TyperCommand as CoreTyperCommand # noqa: E402
2929
from typer.core import TyperGroup as CoreTyperGroup # noqa: E402
3030
from typer.main import get_command as get_typer_command # noqa: E402
@@ -61,6 +61,9 @@
6161
from typing import ParamSpec
6262

6363

64+
DEFAULT_MARKUP_MODE = getattr(typer.core, "DEFAULT_MARKUP_MODE", None)
65+
66+
6467
__all__ = [
6568
"TyperCommand",
6669
"CommandNode",
@@ -895,7 +898,7 @@ def __init__(
895898
deprecated: bool = Default(False),
896899
add_completion: bool = True,
897900
# Rich settings
898-
rich_markup_mode: MarkupMode = None,
901+
rich_markup_mode: typer.core.MarkupMode = Default(DEFAULT_MARKUP_MODE),
899902
rich_help_panel: t.Union[str, None] = Default(None),
900903
pretty_exceptions_enable: bool = True,
901904
pretty_exceptions_show_locals: bool = True,
@@ -1875,7 +1878,7 @@ def __new__(
18751878
add_help_option: bool = Default(True),
18761879
hidden: bool = Default(False),
18771880
deprecated: bool = Default(False),
1878-
rich_markup_mode: MarkupMode = None,
1881+
rich_markup_mode: typer.core.MarkupMode = Default(DEFAULT_MARKUP_MODE),
18791882
rich_help_panel: t.Union[str, None] = Default(None),
18801883
pretty_exceptions_enable: t.Union[DefaultPlaceholder, bool] = Default(True),
18811884
pretty_exceptions_show_locals: t.Union[DefaultPlaceholder, bool] = Default(

doc/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Change Log
33
==========
44

5+
v2.2.2 (25-AUG-2024)
6+
====================
7+
8+
* Fixed `typer > 0.12.5 toggles rich help renderings off by default <https://github.com/bckohan/django-typer/issues/108>`_
9+
510
v2.2.1 (17-AUG-2024)
611
====================
712

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-typer"
3-
version = "2.2.1"
3+
version = "2.2.2"
44
description = "Use Typer to define the CLI for your Django management commands."
55
authors = ["Brian Kohan <[email protected]>"]
66
license = "MIT"
@@ -73,7 +73,7 @@ mypy = "^1.0"
7373
doc8 = "^1.1.1"
7474
aiohttp = "^3.9.1"
7575
readme-renderer = {extras = ["md"], version = ">=42,<44"}
76-
sphinxcontrib-typer = {extras = ["html", "pdf", "png"], version = "^0.3.0", markers="python_version >= '3.9'"}
76+
sphinxcontrib-typer = {extras = ["html", "pdf", "png"], version = "^0.5.0", markers="python_version >= '3.9'"}
7777
scikit-learn = "^1.0.0"
7878
pytest-env = "^1.0.0"
7979
numpy = [

tests/test_examples.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ def test_basic(self):
308308
observed_help = run_command(
309309
"basic", "--settings", self.settings, "--no-color", "--help"
310310
)[0].strip()
311+
# import ipdb
312+
# ipdb.set_trace()
311313
self.assertGreater(
312314
similarity(
313315
observed_help, basic_help if rich_installed else basic_help_no_rich

0 commit comments

Comments
 (0)