scikit-build-core icon indicating copy to clipboard operation
scikit-build-core copied to clipboard

Option to import `pyi` stubs as modules

Open LecrisUT opened this issue 1 year ago • 0 comments

The usecase for this is when we are building the documentation and using autodoc to avoid import failures and avoid cmake building. The user could have something like this setup

[[tool.scikit-build.overrides]]
if.any.env.READTHEDOCS = true
if.any.env.BUILD_DOCS = true
wheel.cmake = false

The logic to be added is that if there is a .pyi stub file without a .py original, then:

  • regular: copy the stub file to a .py file
  • edittable installs: probably ScikitBuildRedirectingFinder needs to be changed to detect .pyi files as modules

LecrisUT avatar Jan 30 '25 11:01 LecrisUT