I added a new decorator called `@docs_argspec` to override the argument specification
of a function used in the docs by setting `func.__wraps__` to a fake function. This only
happens when building the docs, normally it is a no-op.
`@docs_argspec` is needed when using `@overload` because mypy requires the argspec
of the main function to be at least as general as the argspecs of all the overloads, which
causes suboptimal rendering in the api docs.
In #3461 I dropped `sphinx-panels` but of course we *were* using it. It has a successor called
`sphinx-design` which works with sphinx 5.x (still not 6.x but we have several packages that cap
sphinx <6). I also updated the use of the tabbed directive to the new sphinx-design api.
Remove the property prefix from properties, add a link for ast.Module.
Previously this included more significant changes but they have been upstreamed into sphinx-autodoc-typehints.
I opened a PR for one of the Napoleon changes:
https://github.com/sphinx-doc/sphinx/pull/11131
But we use Sphinx v5.3 so even if we upstream Napoleon fixes into Sphinx v6.x,
we won't get to use them for a while.
With this we can get up to Sphinx 5.3.0 (from Sphinx 4.5.0). I dropped sphinx-panels
since it has a version pin on Spinx < 5 (we don't seem to use it anyways). I moved to
sphinx-book-theme 0.4.0rc1 since version 0.3.0 pins Sphinx < 5.
This is relevant because new versions of sphinx-autodoc-typehints require Sphinx>=5.3
so we can't pull in my fixes to sphinx-autodoc-typehints.
In the future, I would like for version caps (==, <, <=, and =~) to have comments
explaining them. I removed all the version caps since none of them seem to actively break.
In particular, we can now use jinja2 version 3 so we don't have to pin docutils 0.16.
The documentation generation seems to get confused by the default export and
displays the `version` field as `default` instead. This switches to a normal export.
Fix various sphinx build warnings.
I removed **all cross-references** in the changelog document. It causes trouble
whenever we make an API change.
For example, Hood did some great work of splitting JsProxy classes into subclasses
in this release, but the changelog of older versions still contains cross-references to
`JsProxy.<method>` which doesn't exist anymore. It doesn't make sense to change it
to e.g. `JsBuffer.<method>` or `JsArray.<method>` as those classes are not available in
that version, so I think the reasonable option would be not using cross-references.
Added type parameters to `JsArray`, `JsMap`, `JsMutableMap`, etc. Based on
[the typesheds for typing](https://github.com/python/typeshed/blob/main/stdlib/typing.pyi).
I skipped `JsCallable` and a few other more complicated types, those can be handled later.
We are pushing pyodide_build to PyPI as a Python package, but for now,
installing pyodide_build from PyPI (i.e. pip install pyodide_build`) is almost
useless because:
there are bunch of hard-coded paths (e.g. Path(__file__).parents[2]),
its dependencies are not specified in setup.cfg.
This PR is for mitigating this situation by removing hard-coded paths and
adding tests, and is also a preparation for our new CLI
(https://github.com/pyodide/pyodide/issues/1977).