Skip to content

Introspection: add a CLI to generate stubs#5904

Open
Tpt wants to merge 2 commits intoPyO3:mainfrom
Tpt:tpt/introspection-bin
Open

Introspection: add a CLI to generate stubs#5904
Tpt wants to merge 2 commits intoPyO3:mainfrom
Tpt:tpt/introspection-bin

Conversation

@Tpt
Copy link
Copy Markdown
Contributor

@Tpt Tpt commented Mar 23, 2026

Useful for setuptools-rust

Use it also for the integration tests

@Tpt Tpt force-pushed the tpt/introspection-bin branch from 01e663d to 70f0bd1 Compare March 23, 2026 09:52
Useful for setuptools-rust

Use it also for the integration tests
@Tpt Tpt force-pushed the tpt/introspection-bin branch from 70f0bd1 to b5efccb Compare March 23, 2026 09:55
@Tpt Tpt marked this pull request as ready for review March 23, 2026 10:19
@Tpt Tpt force-pushed the tpt/introspection-bin branch from bc46553 to 27af589 Compare March 25, 2026 18:14
@davidhewitt
Copy link
Copy Markdown
Member

Thanks, the binary implementation looks fine to me (and matches what I've done locally in testing previously).

Some thoughts / questions:

  • Will we ship prebuilt versions of this, e.g. on this repository? If no, will setuptools-rust build it from scratch?
  • Does this affect any planned integration with maturin (e.g. make it irrelevant?)
  • Should we document how to use this in type-stub.md?

@Tpt
Copy link
Copy Markdown
Contributor Author

Tpt commented Mar 31, 2026

Will we ship prebuilt versions of this, e.g. on this repository? If no, will setuptools-rust build it from scratch?

Good question. Building in this repository and publish on pypi is likely the easiest and nicest way to go. This way setuptools-rust can just depend on it. Glad to do the basic setup if you are ok with this idea.

Does this affect any planned integration with maturin (e.g. make it irrelevant?)

No, maturin integration is imho still very relevant as an "integrated" tool doing everything (build + introspection). We just merged PyO3/maturin#3105 with first integration bit (a --generate-stubs option that adds stubs to the built artifacts).

Should we document how to use this in type-stub.md?

Definitely. Waiting for the next release is maybe better to not confuse the reader by talking about a not released tool. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants