Open azmeuk opened 6 months ago
I rarely use flask and have never written a flask CLI plugin, but I'm happy to accept PRs to fix this if you can figure out what needs to be done.
As a workaround, you might be able to mock that decorator (or the things it's calling). More information on mocking here.
I would like to generate documentation for dynamically generated click commands, depending on a Flask context. Running
sphinx-build
raisesRuntimeError: There is no active click context.
, while running the commands works as expected (for instancepython commands.py sub foo
)The code consists in a
ParametrizedCommand
class that dynamically generate a list of commands. For the sake of simplicity on this snippet, this is not quite dynamical, but at least this generate the very same exception I meet with my more complex real world use case.Removing
@with_appcontext
would makesphinx-build
work, but I cannot do this since I need the application context inget_command
in my real use case.commands.py
index.rst
traceback