Skip to content

Fail to Build with asyncclick #80

Open

Description

@jayceslesar

Unable to use this with https://github.com/python-trio/asyncclick, which should be a pretty much drop in replacement.

The error I receive is

mkdocs_click._exceptions.MkDocsClickException: 'cli' must be a 'click.BaseCommand' object, got <class 'asyncclick.core.Group'>

Happy to hack on this if its something useful

Activity

  1. jayceslesar commented on Jan 22, 2025

    @jayceslesar
    Author

    yeah literally just commenting out https://github.com/mkdocs/mkdocs-click/blob/master/mkdocs_click/_loader.py#L20 seems to work fine so might be worth just adding the async click as an optional mkdocs dependency here and dealing with it that way....IE attempt to import and if it is not None, then add it to the check if not isinstance(command, [click.BaseCommand, asyncclick.core.Group]) otherwise the iterable will just be if not isinstance(command, [click.BaseCommand] )

  2. ofek commented on Jan 22, 2025

    @ofek

    A PR would be greatly appreciated! However, my preference would be adding a new command-class option that defaults to click.BaseCommand. The benefit of this approach is that any package becomes compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions