[Mlir-commits] [llvm] [mlir] [MLIR][Python] enable type stub auto-generation (PR #155741)

Maksim Levental llvmlistbot at llvm.org
Wed Sep 3 10:31:23 PDT 2025


makslevental wrote:

> had to define some [signatures](https://github.com/substrait-io/substrait-mlir-contrib/blob/1e6f422/python/SubstraitDialects.cpp#L81-L84) by hand because stubgen didn't generate the full module prefix of the types and a file with fix-up [patterns](https://github.com/substrait-io/substrait-mlir-contrib/blob/1e6f422/python/CMakeLists.txt#L92) because either __str__ or __repr__ of some enum class wasn't generated with the correct signature. I now think that the manual signatures https://github.com/substrait-io/substrait-mlir-contrib/issues/171 and could instead be made correct with a few generic patterns

Yea I saw you'd hand-written some signatures and I was planning on doing the same (though in a follow-up PR). But the patterns file looks like a winner so I'll do that instead. 

> Also, maybe we can ask the nanobind devs if they have an estimate on when the new release comes out and wait for that to happen.

Yea I asked and it's like [1-2 weeks away](https://github.com/wjakob/nanobind/pull/1124#issuecomment-3243864224) so we could wait - I'm just impatient sometimes :)

https://github.com/llvm/llvm-project/pull/155741


More information about the Mlir-commits mailing list