CI: Add a copy of stub files to the repo

When cross-compiling the extension code (e.g., osx-arm64 on conda-forge) the shared library cannot be imported on the host, so the stubs can't be generated. This means they are missing from the package.

Now we keep a copy in the repo. There are small variations across platforms and Python versions. We are currently using Linux/macOS and Python 3.13 - these give identical results. CI will check if the stubs in the repo are up to date (but only on Python 3.13).

When building wheels and conda packages, if fresh stubs can be generated they will still be included.

Changes:

  • We can't use class as an argument name. There are also some signal handling overloads that should be the same on macOS and Linux - the special case is Windows.
  • Do some basic cleanup of the stub docstrings using ruff. This also makes the results more consistent across different platforms.

Merge request reports

Loading