Skip to content

Make stub docstring generation available outside cibuildwheel #1293

Open

Description

@jonathanberthias

#1274 adds runtime docstrings to the bundled type stubs through cibuildwheel’s repair hook. Builds that do not use cibuildwheel, including conda-forge, bypass this step. As pointed out by @mkoeppe in this comment, the documentation should also be made available through conda-forge builds.

Possible approaches:

  1. Customize setuptools commands: extract docstrings after compilation, before setuptools packages the wheel.
  2. Wrap setuptools.build_meta: let setuptools build the wheel, then unpack it, add docstrings, and repack it. This means moving this process from cibuildwheel to setuptools.
  3. Use another build backend, e.g. Hatchling, which provides build hooks.
  4. Add an equivalent step in the conda-forge build process; this is likely the easiest change, though it does not cover source builds.

Generation should remain optional, so distribution builds can enable it without adding work to the development workflow. Options 1–3 could expose a build setting or environment variable to enable extraction.

Activity

  1. added this to the v7.0.0 milestone on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions