-
Notifications
You must be signed in to change notification settings - Fork 207
Cleanup console output during build #250
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
Conversation
This looks quite good. Have you tested this with an old sphinx version e.g. 1.5 or even 1.4? |
I tried with 1.4.8, but I'm not sure how old a sphinx is supported. |
Sphinx-1.4.8 is on ubuntu16.10. On travis our oldest supported platform is the ubuntu14.04 and there we enforce sphinx-1.4.9(not 1.2.2 as in the distribution) and that is because the huge problems Sphinx-1.5 caused(and story repeats now with Sphinx-1.6), so we test on a version just before that. Up until that point things didn't change so drastically in Sphinx. My point of view would be not to try to support even older version, and only add a new entry into travis a test for Sphinx-1.5 on a ubuntu14 machine which is the oldest we support. |
I will reference to #65, where conclusion was to have an indicator of progress through stdout, and that error messages should be easy to find. I would really like to keep information of which example gave the output, instead of it being text polluting the logs, without any context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice. I would also rename compat.py to sphinx_compatibility.py
I prefer more explicit naming
sphinx_gallery/tests/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def fakeapp(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you rename it to fakesphinxapp.
sphinx_gallery/tests/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def logcap(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to:
- capture_logs
- log_collector
- log_grabber
- any better name that makes it explicit what this does or is intended for which use.
I'm not sure it would be possible to keep outputs together without capturing output from the examples. And I'm thinking that perhaps if that were done, the output should go in the HTML (also?). |
This will avoid a warning with new versions of Sphinx and any trouble when it gets fully removed. Fixes sphinx-gallery#247.
Oh, I didn't realize that there's already stdout capture and passed through a tee to the console. I just took out the tee and logged it as verbose; then it can be seen by setting Sphinx logging to verbose. |
Thank you for working on this. Merging |
This PR tries to reduce the console output during a build, as well as pass a lot of status message through the Sphinx logging API. This gives the immediate benefit of matching styling with Sphinx easily. I tried to add colours to various items to match Sphinx appearance, but I'm open to suggestions as to the logging level of the messages.
Before:


After:
Since sphinx-gallery's documentation prints a lot, it might not totally clear, so here's a Matplotlib doc build with the patched branch:

Fixes #230.