Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to Build with asyncclick #80

Open
jayceslesar opened this issue Jan 22, 2025 · 2 comments · May be fixed by #81
Open

Fail to Build with asyncclick #80

jayceslesar opened this issue Jan 22, 2025 · 2 comments · May be fixed by #81

Comments

@jayceslesar
Copy link

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

@jayceslesar
Copy link
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] )

@ofek
Copy link
Collaborator

ofek commented Jan 22, 2025

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.

@jayceslesar jayceslesar linked a pull request Jan 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants