Ignore warnings about missing include with "only" directive. Ref: https://github.com/sphinx-doc/sphinx/issues/2150.
(self, record: logging.LogRecord)
| 405 | |
| 406 | class WarnLogFilter(logging.Filter): |
| 407 | def filter(self, record: logging.LogRecord) -> bool: |
| 408 | """Ignore warnings about missing include with "only" directive. |
| 409 | |
| 410 | Ref: https://github.com/sphinx-doc/sphinx/issues/2150.""" |
| 411 | if ( |
| 412 | record.msg.startswith('Problems with "include" directive path:') |
| 413 | and "_changelog_towncrier_draft.rst" in record.msg |
| 414 | ): |
| 415 | return False |
| 416 | return True |
| 417 | |
| 418 | logger = logging.getLogger(sphinx.util.logging.NAMESPACE) |
| 419 | warn_handler = [x for x in logger.handlers if x.level == logging.WARNING] |
no outgoing calls