.. automodule:: demo :members: :undoc-members: :show-inheritance:
Last active
February 15, 2021 22:50
-
-
Save PeterJCLaw/b017b2869590036d3d05a427fd9f34d0 to your computer and use it in GitHub Desktop.
Minimal demo of Flask error from Werkzeug 2 change when Sphinx builds docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/out | |
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
python -m sphinx -T -E . out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extensions = [ | |
'sphinx.ext.autodoc', | |
] | |
source_suffix = '.rst' | |
master_doc = 'index' | |
project = 'demo' | |
release = '1.0.0' | |
version = '1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snip> | |
File "/tmp/venv/lib/python3.8/site-packages/sphinx/util/inspect.py", line 234, in ispartial | |
return isinstance(obj, (partial, partialmethod)) | |
File "/tmp/venv/lib/python3.8/site-packages/werkzeug/local.py", line 379, in __get__ | |
obj = instance._get_current_object() | |
File "/tmp/venv/lib/python3.8/site-packages/werkzeug/local.py", line 499, in _get_current_object | |
return self.__local() # type: ignore | |
File "/tmp/venv/lib/python3.8/site-packages/flask/globals.py", line 45, in _lookup_app_object | |
raise RuntimeError(_app_ctx_err_msg) | |
RuntimeError: Working outside of application context. | |
This typically means that you attempted to use functionality that needed | |
to interface with the current application object in some way. To solve | |
this, set up an application context with app.app_context(). See the | |
documentation for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sphinx | |
Werkzeug==2.0.0rc1 | |
Flask |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment