diff --git a/examples/IPython.toml b/examples/IPython.toml index 2da2067f..ca6f526f 100644 --- a/examples/IPython.toml +++ b/examples/IPython.toml @@ -5,31 +5,18 @@ exec_failure = "fallback" docs_path = "~/dev/IPython/docs/source" exec = true execute_exclude_patterns = [ - 'IPython.lib.display.Audio', - 'IPython.core.display_functions.display' + 'IPython.lib.display:Audio', + 'IPython.core.display_functions:display' ] exclude = [] [global.expected_errors] IncorrectInternalDocsLen = [ - "IPython.core.magics.basic:BasicMagics.alias_magic", - "IPython.core.magics.script:ScriptMagics.shebang", - "IPython.core.magics.basic:BasicMagics.notebook", - "IPython.core.magics.display:DisplayMagics.html", - "IPython.core.magics.execution:ExecutionMagics.debug", - "IPython.core.magics.execution:ExecutionMagics.capture", - "IPython.core.magics.history:HistoryMagics.history", "IPython.core.magics.namespace:NamespaceMagics.xdel", - "IPython.core.magics.osm:OSMagics.writefile", - "IPython.core.magics.pylab:PylabMagics.matplotlib", - "IPython.core.magics.pylab:PylabMagics.pylab", - "IPython.terminal.embed:EmbeddedMagics.kill_embedded", ] +[global.implied_imports] +get_ipython = 'IPython:get_ipython' -ValueError = [ - "IPython.core.magics.osm:OSMagics.env", - "IPython.core.magics.osm:OSMagics.set_env", -] [meta] github_slug = 'IPython/IPython' diff --git a/examples/numpy.toml b/examples/numpy.toml index 50f19bc4..fc4e6e31 100644 --- a/examples/numpy.toml +++ b/examples/numpy.toml @@ -1,11 +1,14 @@ [global] module = 'numpy' +exclude = ['numpy.distutils.misc_util:Configuration.__init__','numpy:tensordot'] + execute_exclude_patterns = ['numpy._','numpy.testing._priv', 'numpy.errstate', 'numpy.seterr', 'numpy.bincount', 'numpy.core._multiarray_umath.bincount', 'numpy.core._multiarray_umath.datetime_as_string', 'numpy.core._multiarray_umath.normalize_axis_index', 'numpy.core._multiarray_umath.shares_memory', 'numpy.datetime_as_string', 'numpy.shares_memory', 'numpy.squeeze', 'numpy.average', 'numpy.ctypeslib', 'numpy.append', 'numpy.ma.core', +'numpy.core.umath_tests', # try to create a pager that waits for input 'numpy.lookfor', @@ -16,6 +19,8 @@ execute_exclude_patterns = ['numpy._','numpy.testing._priv', 'numpy.errstate', ' 'numpy.char.multiply', 'numpy.polynomial.chebyshev.chebinterpolate', 'numpy.lib.npyio._read', +'numpy.polynomial._polybase:ABCPolyBase', +'numpy.distutils.misc_util:Configuration.__init__' ] submodules = [ @@ -45,7 +50,8 @@ exec = true narrative_exclude = [ 'doc/source/reference/arrays.ndarray.rst', 'doc/source/user/how-to-how-to.rst', - 'doc/source/f2py/usage.rst' + 'doc/source/f2py/usage.rst', + 'doc/source/_templates/', ] exec_failure = 'fallback' source = 'https://github.com/numpy/numpy' @@ -63,25 +69,7 @@ docspage = 'https://numpy.org/doc/1.22/' [global.expected_errors] -ValueError = [ - "numpy.core.shape_base._concatenate_shapes", - "numpy.rollaxis", - ] -NumpydocParseError = [ - "numpy._from_dlpack", - "numpy.typing._nested_sequence._NestedSequence", - "numpy.polynomial._polybase.ABCPolyBase", - ] VisitCitationReferenceNotImplementedError = [ "numpy.fft", ] -VisitSubstitutionDefinitionNotImplementedError = [ - ] -IncorrectInternalDocsLen = [ - "numpy.tensordot", - "numpy.lib._datasource.DataSource._splitzipext", - "numpy.core._internal._view_is_safe", - "numpy.distutils.misc_util.Configuration.__init__",] -AssertionError = [ -] diff --git a/papyri/crosslink.py b/papyri/crosslink.py index 1d62ba96..e9753039 100644 --- a/papyri/crosslink.py +++ b/papyri/crosslink.py @@ -431,9 +431,7 @@ def relink(self) -> None: rev_aliases = {Cannonical(v): FullQual(k) for k, v in aliases.items()} - print( - "Relinking is safe to cancel, but some back references may be broken...." - ) + print("Relinking is safe to cancel, but some back references may be broken....") print("Press Ctrl-C to abort...") for _, key in self.progress( diff --git a/papyri/gen.py b/papyri/gen.py index eba6f4e7..e411bc12 100644 --- a/papyri/gen.py +++ b/papyri/gen.py @@ -32,6 +32,7 @@ from typing import Any, Dict, FrozenSet, List, MutableMapping, Optional, Sequence, Tuple import jedi + try: import tomllib except ModuleNotFoundError: @@ -1311,7 +1312,7 @@ def collect_narrative_docs(self): p2.update(task, description=compress_user(str(p)).ljust(7)) p2.advance(task) - if any([str(p).endswith(k) for k in self.config.narrative_exclude]): + if any([k in str(p) for k in self.config.narrative_exclude]): print_(f"Skipping {p} – excluded in config file") continue @@ -2090,7 +2091,8 @@ def collect_api_docs(self, root: str, limit_to: List[str]): self.put_raw(name, data) if error_collector._errors: self.log.info( - "ERRORS:" + tomli_w.dumps(error_collector._errors).replace(",", ", \n") + "ERRORS:" + + tomli_w.dumps(error_collector._errors).replace(",", ", \n") ) if error_collector._expected_unseen: self.log.info( diff --git a/papyri/take2.py b/papyri/take2.py index 2a11e660..fc3751ff 100644 --- a/papyri/take2.py +++ b/papyri/take2.py @@ -342,6 +342,7 @@ class Param(Node): MList, MParagraph, MCode, + SubstitutionDef, ] ] @@ -498,6 +499,7 @@ class DefListItem(Node): Unimplemented, MAdmonition, MMath, + FieldList, Optional[TocTree], # remove this, that should not be the case ? ] ] diff --git a/papyri/tree.py b/papyri/tree.py index 01585124..06054535 100644 --- a/papyri/tree.py +++ b/papyri/tree.py @@ -806,13 +806,13 @@ def _import_max(parts): p = parts[0] try: __import__(p) - except ImportError: + except (ImportError, RuntimeError): return for k in parts[1:]: p = p + "." + k try: __import__(p) - except ImportError: + except (ImportError, RuntimeError): return except Exception as e: raise type(e)(parts) diff --git a/papyri/ts.py b/papyri/ts.py index 8f4d7e8c..bbea132e 100644 --- a/papyri/ts.py +++ b/papyri/ts.py @@ -439,7 +439,7 @@ def visit_section(self, node, prev_end=None): # blah blah reference and new line with parenthesis # (like a year here) # ``` - assert len(set_post_a) == 1 + assert len(set_post_a) == 1, breakpoint() post_a = next(iter(set_post_a)) assert len(post_text) >= len(self.as_text(tc)), self.as_text(tc)