Skip to content

Commit

Permalink
fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed May 29, 2024
1 parent 75f468b commit f06c339
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Change Log
==========

v0.2.4
======

* Fixed `Support more flexible duck typing for detecting Typer objects <https://github.com/sphinx-contrib/typer/issues/25>`_

v0.2.3
======

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sphinxcontrib-typer"
version = "0.2.3"
version = "0.2.4"
description = "Auto generate docs for typer commands."
authors = ["Brian Kohan <[email protected]>"]
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion sphinxcontrib/typer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
from typer.main import get_command as get_typer_command
from typer.models import Context as TyperContext

VERSION = (0, 2, 3)
VERSION = (0, 2, 4)

__title__ = "SphinxContrib Typer"
__version__ = ".".join(str(i) for i in VERSION)
Expand Down Expand Up @@ -295,6 +295,7 @@ def resolve_root_command(obj):
if isinstance(obj, (click.Command, click.Group)):
return obj

# use lenient duck typing check incase obj is a proxy for a Typer instance
if isinstance(obj, Typer) or isinstance(getattr(obj, "info", None, TyperInfo)):
return get_typer_command(obj)

Expand Down

0 comments on commit f06c339

Please sign in to comment.