chore: silence warnings in documentation build - #1718
Draft
timsaucer wants to merge 1 commit into
Draft
Conversation
`nb_execution_mode = "force"` starts a Jupyter kernel per executed page, and
each start printed two messages that have nothing to do with this build:
[IPKernelApp] WARNING | Kernel is running over TCP without encryption...
UserWarning: IPython parent '<home>' is not a writable location...
Together they accounted for every line of the build's stderr, which makes a
real Sphinx warning easy to miss. The build log is now empty on success.
The encryption notice is not describing a risk here. The kernel is a
short-lived child process on the same machine, executing pages from this
repository, reachable only over loopback.
Neither remedy the message suggests works. `transport="ipc"` silences it and
executes fine in isolation, but the real build then fails with "Kernel didn't
respond in 60 seconds". `KernelManager.transport_encryption = "auto"` fails at
kernel start on jupyter_client 8.9.1, which hands the provisioned CurveZMQ key
to the client as `str` where a `bytes` trait is expected. So the message is
filtered instead, by a logging filter matched to that one string rather than by
`log_level = "ERROR"`, so any other kernel warning still reaches the log. If
ipykernel rewords the message the filter stops matching and the warning
returns, which is the right way for it to fail.
The filter lives in `docs/ipython_kernel_config.py`, which `build.sh` copies
into a throwaway `IPYTHONDIR` profile. It has to be an IPython profile rather
than a `JUPYTER_CONFIG_PATH` entry, because `IPKernelApp` derives from
`BaseIPythonApplication` and reads the IPython profile directory —
`IPKernelApp().config_file_paths` is empty. Pointing `IPYTHONDIR` at a
writable directory is also what removes the second message.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No issue reported.
Rationale for this change
This is for developer convenience. Right now we generate a lot of unnecessary warnings that don't really apply to our documentation build. This PR silences these warnings.
What changes are included in this PR?
Are there any user-facing changes?
None.