Skip to content

Commit ded7353

Browse files
committed
chore: bump sphinx-click-rst-to-ansi-formatter to 0.2.0
Subclass RstToAnsiGroup directly instead of using a TYPE_CHECKING workaround.
1 parent 9c694b5 commit ded7353

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎pyproject.toml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies = [
2929
"click>=8.1.7",
3030
"scim2-client[httpx2]>=0.11.2",
3131
"scim2-tester>=0.4.0",
32-
"sphinx-click-rst-to-ansi-formatter>=0.1.0",
32+
"sphinx-click-rst-to-ansi-formatter>=0.2.0",
3333
"pydanclick>=0.5.0",
3434
"pygments>=2.18.0",
3535
]
@@ -69,7 +69,8 @@ scim2 = "scim2_cli:cli"
6969

7070
[tool.uv]
7171
exclude-newer = "14 days"
72-
exclude-newer-package = { scim2-models = false, scim2-client = false, scim2-server = false, scim2-cli = false, scim2-tester = false, pytest-scim2-server = false }
72+
# TODO: remove sphinx-click-rst-to-ansi-formatter after 2026-10-20, when 0.2.0 is older than 14 days.
73+
exclude-newer-package = { scim2-models = false, scim2-client = false, scim2-server = false, scim2-cli = false, scim2-tester = false, pytest-scim2-server = false, sphinx-click-rst-to-ansi-formatter = false }
7374

7475
[tool.uv.build-backend]
7576
module-root = ""

‎scim2_cli/utils.py‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import re
33
from collections.abc import Callable
44
from enum import StrEnum
5-
from typing import TYPE_CHECKING
65
from typing import Any
76

87
import click
@@ -12,7 +11,7 @@
1211
from scim2_models import Mutability
1312
from scim2_models import Resource
1413
from scim2_models import SCIMException
15-
from sphinx_click.rst_to_ansi_formatter import make_rst_to_ansi_formatter
14+
from sphinx_click.rst_to_ansi_formatter import RstToAnsiGroup
1615

1716
DOC_URL = "https://scim2-cli.readthedocs.io/"
1817
INDENTATION_SIZE = 4
@@ -82,16 +81,11 @@ def split_headers(headers: list[str]) -> dict[str, str]:
8281
}
8382

8483

85-
# mypy cannot subclass a class built at runtime by a factory.
86-
if TYPE_CHECKING:
87-
RSTCommand = click.Group
88-
else:
89-
RSTCommand = make_rst_to_ansi_formatter(DOC_URL, group=True)
90-
91-
92-
class ModelCommand(RSTCommand):
84+
class ModelCommand(RstToAnsiGroup):
9385
"""CLI commands that takes a model subcommand."""
9486

87+
base_url = DOC_URL
88+
9589
def __init__(
9690
self,
9791
*args: Any,

‎uv.lock‎

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)