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
Sphinx silently drops warnings when libraries like 'airflow' or 'mlflow' are imported in the middle of the build #9733
Comments
Just tried upgrading to Sphinx 4.2.0 and confirmed that warnings are still missing after the upgrade. |
Another useful bit of information - the warnings still show up if you run sphinx with '-vv' and filter for WARNING (they just aren't output by sphinx normally, and they don't stop the build if you run with '-W'): e.g. in the bug report above, without making any changes,
succeeds without logging any warnings (or failing), but:
shows the warnings: /Users/dgibson/dagster/docs/sphinx/sections/api/apidocs/experimental.rst:72: (WARNING/2) Title underline too short. Similarly, the import error from autodoc seems to not be raised even though it can be found in the verbose logs. |
Closes #9733: Fix for logging handler flushing warnings in the middle of the docs build
Describe the bug
I'm finding that sphinx does not emit warnings that it should be emitting.
For example, there is a typo here: https://github.com/dagster-io/dagster/blob/master/docs/sphinx/sections/api/apidocs/execution.rst#L56
ReeconstructablePipeline
should beReconstructablePipeline
(there is an extra 'e' character), which should produce a Sphinx warning since the class does not exist.Confusingly, I'm finding that the expected warnings start appearing when I reduce the number of libraries in my environment, even when the libraries that I remove are not specifically required by the sphinx build. I noticed this when I tried to start using autodoc_mock_imports to reduce our imports - suddenly, a bunch of unrelated warnings started appearing.
It does not seem that including a specific library causes the problem (I verified this by attempting to bisect the problem by reducing libraries one by one) - once I reduce the number of libraries in my virtual environment enough, the expected warnings begin appearing again during the build.
See specific reproduction instructions below. Thanks for any help you can provide.
How to Reproduce
(in a fresh virtualenv with pip 19.2.3 installed)
(sphinx will build successfully with no warnings, despite having the ReeconstructablePipeline typo mentioned above that should generate a warning and thus an error due to the -W flag)
Now, to make the warning appear, follow these steps to remove a bunch of libraries that are not actually needed by the sphinx build (it does not seem that there's one individual library that specifically causes the problem - I attempted to find one by bisecting, but it seems that it's just a matter of removing enough libraries):
The sphinx build will now correctly create a warning for the typo:
Expected behavior
Sphinx will always produce warnings for missing classes
Your project
https://github.com/dagster-io/dagster/tree/sphinxbugreport/docs/sphinx
Screenshots
No response
OS
Mac
Python version
3.8.3
Sphinx version
3.5.2
Sphinx extensions
sphinx.ext.autodoc, sphinx.ext.ifconfig, sphinx.ext.intersphinx, sphinx.ext.viewcode, nbsphinx, sphinx.ext.autosectionlabel
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: