-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Can the IPython directive use warnings for errors? #11547
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
Comments
That seem to be reasonable to me. Feel free to send a pull request. @LucianaMarques might also want to take a shot at it ? |
@Carreau yes, thank you! :) @TomAugspurger I would like to contribute to make this work, can we discuss it? Thanks! |
Sure, let me know if you have any questions.
I pushed my example to https://github.com/TomAugspurger/sphinx-test and am
building with `sphinx-build -W --keep-going "." _build/`.
Ideally that would exit with a non-zero exit code.
…On Wed, Jan 9, 2019 at 9:29 AM Luciana da Costa Marques < ***@***.***> wrote:
@Carreau <https://github.com/Carreau> yes, thank you! :)
@TomAugspurger <https://github.com/TomAugspurger> I would like to
contribute to make this work, can we discuss it? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11547 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHImbJvMvDsoQBNDcyqThRoIHmobCNks5vBgrfgaJpZM4ZzkOJ>
.
|
@TomAugspurger thank you for the explanation, I will take a loot at it and get back here. |
@Carreau could you assign this to me, please? |
I don't think I can assign to people that do not have commit rights. Just leaving a comment saying you want to work on it is enough. |
Matplotlib also wants to fail CI if there are any errors in the docs. |
Which is to say I am 👍 on this change. |
Pandas would like to have a workflow where
For regular sphinx things, this works with a combination of
-W error --keep-going
, which fails the job at the end of the build if there were any warnings.This doesn't work with exceptions in IPython blocks. Here's a small example
And the relevant IPytyhon conf setting is
ipython_warning_is_error = False
.When I run
The entire document is built, but the exit code is
0
, when I'd like it to be1
.I hope this is just because exceptions in IPython blocks are printed to stdout. On some basic testing, it looks like using
sphinx.util.logging
andlogger.warning
rather thansys.stdout.write
will satisfy my needs.Are the IPython devs open to changing from
sys.stdout.write
tologger.warning
for this?cc @tacaswell, and idea if this change would break matplotlib at all?
The text was updated successfully, but these errors were encountered: