MCPcopy Create free account
hub / github.com/ipython/ipython / ConfigtraitFilter

Class ConfigtraitFilter

docs/source/conf.py:126–138  ·  view source on GitHub ↗

This is a filter to remove in sphinx 3+ the error about config traits being duplicated. As we autogenerate configuration traits from, subclasses have lots of duplication and we want to silence them. Indeed we build on travis with warnings-as-error set to True, so those duplicate i

Source from the content-addressed store, hash-verified

124import logging
125
126class ConfigtraitFilter(logging.Filter):
127 """
128 This is a filter to remove in sphinx 3+ the error about config traits being duplicated.
129
130 As we autogenerate configuration traits from, subclasses have lots of
131 duplication and we want to silence them. Indeed we build on travis with
132 warnings-as-error set to True, so those duplicate items make the build fail.
133 """
134
135 def filter(self, record):
136 if record.args and record.args[0] == 'configtrait' and 'duplicate' in record.msg:
137 return False
138 return True
139
140ct_filter = ConfigtraitFilter()
141

Callers 1

conf.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected