4848 "mne.viz" ,
4949]
5050
51+ pyproject_path = Path (__file__ ).parents [2 ] / "pyproject.toml"
52+ if not pyproject_path .is_file ():
53+ pytest .skip (f"pyproject.toml not found: { pyproject_path } " , allow_module_level = True )
54+ try :
55+ import tomllib
56+ except ModuleNotFoundError :
57+ # TODO VERSION: Remove this when Python 3.11+ is required
58+ pytest .skip ("tomllib not available" , allow_module_level = True )
59+
60+ pyproject = tomllib .loads (pyproject_path .read_text ("utf-8" ))
61+ numpydoc_checks = pyproject ["tool" ]["numpydoc_validation" ]["checks" ]
62+ assert numpydoc_checks [0 ] == "all"
63+ error_ignores = set (numpydoc_checks [1 :])
64+
5165
5266def _func_name (func , cls = None ):
5367 """Get the name."""
@@ -73,21 +87,6 @@ def _func_name(func, cls=None):
7387 "mne.channels.tests.test_montage" ,
7488 "mne.io.curry.tests.test_curry" ,
7589]
76- error_ignores = {
77- # These we do not live by:
78- "GL01" , # Docstring should start in the line immediately after the quotes
79- "GL02" , # Closing quotes on own line (doesn't work on Python 3.13 anyway)
80- "EX01" ,
81- "EX02" , # examples failed (we test them separately)
82- "ES01" , # no extended summary
83- "SA01" , # no see also
84- "YD01" , # no yields section
85- "SA04" , # no description in See Also
86- "PR04" , # Parameter "shape (n_channels" has no type
87- "RT02" , # The first line of the Returns section should contain only the type, unless multiple values are being returned # noqa
88- # XXX should also verify that | is used rather than , to separate params
89- # XXX should maybe also restore the parameter-desc-length < 800 char check
90- }
9190error_ignores_specific = { # specific instances to skip
9291 ("regress_artifact" , "SS05" ), # "Regress" is actually imperative
9392}
0 commit comments