Comments (4)
I am also observing this issue. In my project, when I attempt to generate docs, I get:
make build BUILD_ARGS="-W"
make[1]: Entering directory '/home/regis/projets/overhang/repos/overhang/tutor/docs'
sphinx-build -b html -a -E -n -W "." "_build/html"
Running Sphinx v4.2.0
building [mo]: all of 0 po files
building [html]: all source files
updating environment: [new config] 42 added, 0 changed, 0 removed
reading sources... [ 57%] reference/cli/tutor
Exception occurred:
File "/home/regis/projets/overhang/repos/overhang/tutor/tutor/commands/cli.py", line 49, in get_commands
actions.do_action_once("root:load", ctx.params["root"])
TypeError: list indices must be integers or slices, not str
The full traceback has been saved in /tmp/sphinx-err-ien2tje3.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[1]: *** [Makefile:5: build] Error 2
make[1]: Leaving directory '/home/regis/projets/overhang/repos/overhang/tutor/docs'
make: *** [Makefile:8: html] Error 2
It is occurring as I am trying to implement a custom MultiCommand class to load subcommands from plugins, very much as described in the click docs: https://click.palletsprojects.com/en/latest/commands/#custom-multi-commands
You can see my custom implementation here: https://github.com/overhangio/tutor/pull/599/files#diff-135f3cab863e666db1ab4b3c1a36f125f11501065e0cae258d73d706b5dfae56R30
The context argument (which is here a MultiCommand) that is passed to list_command
and get_command
is not used by the base Group
implementation. Thus, the bug does not occur in most cases.
The fix should be relatively straightforward and I can open a PR. Would you be interested? Is a unit test necessary?
from sphinx-click.
I'd definitely be interested. Tests would be appreciated since they prove things are working as expected. Ideally there would be two commits: one to add (failing) unit test(s) and one to fix the bug and the test. Just try your best and let me know if you really can't figure it out.
from sphinx-click.
Fixing this would likely unblock #83 also.
from sphinx-click.
Unfortunately the proposed fix does not 100% resolve this issue. The context must also be passed to get_command
, as suggested above. I opened #101 to resolve this.
from sphinx-click.
Related Issues (20)
- add build-backend to pyproject.toml
- 4.0.0: sphinx warnings `reference target not found` HOT 7
- Missing detection of envvars via auto_envvar_prefix-option HOT 1
- Extend \b rewrapping to click options HOT 2
- Nested subcommands improvement HOT 1
- Supports `.. click:example::` and `.. click:run::` directives HOT 3
- Option defaults with escape characters don't render correctly HOT 5
- <class ‘click.core.Command’>” of type “scripts.my module:mycommand” is not click.Command or click.Group.”click.BaseCommand” HOT 1
- metavar in docs does not match metavar in help output HOT 2
- Missing show_default detection via context_settings. HOT 1
- _format_envvars does not seem to support auto_envvar_prefix on group HOT 1
- remove "Required argument" from every click arg HOT 1
- Sphinx_click not working with Read The Docs HOT 2
- Issue with sphinx 7.0 HOT 2
- "\b" prevents formatting HOT 1
- Support myst-parser HOT 3
- Document sub-command only
- Show list of commands HOT 1
- Tests fail with click 8.1.x HOT 1
- :nested: full doesn't work anymore HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-click.