Closed nyckmaia closed 2 years ago
Hi!
Thanks for the question.
MUST BE already installed in a Python environment, right?
Yes, it must be available, but it might be installed via pip --install .
, i.e. without creating a distribution. This can be an intermediate step of your CI pipeline.
Once stubs are generated, you are can package them for distribution as described in PEP 561 (don't forget to include py.typed
file to indicate that package provides stubs).
I don't have a simple example of my own projects. But maybe you will this ci snippet that uses pybind11-stubgen
wrapper helpful.
Hi, I'm a newer in Python stubs.
Today I compile my
C++
code to aPython Module
usingPybind11
. If I understood how it works, to usepybind11-stubgen
myModule
MUST BE already installed in a Python environment, right?If yes, so I have to follow these steps below:
pybind11
)setup.py
)pybind11-stubgen
, get the output files and copy them to the same folder where my module was installedRight?
I would like to automatize this process and generate the
stubs
BEFORE run my module installationsetup.py
. If is possible, it will enable to runsetup.py
once and get bothmyModule
andmyModuleStubs
installed at the same time.Question
Is there a way to do that?
Thank you,