Skip to content

Failed to generate stub file for my package #237

@zhang-qiang-github

Description

@zhang-qiang-github

The pybind11 code to generate module is:

class A
{
public:
	A()
	{

	}

	/**
	* @brief explanation from c++
	*/
	int Add(int a, int b)
	{
		return a+b; 
	}

};

PYBIND11_MODULE(module, m) {


    m.doc() = "My Library Python Bindings";

	py::class_<A>(m, "A")
		.def(py::init<>())
		.def("Add", &A::Add, "explanation from pybind");

}

And it successfully generated a python module, and I can import it:

image

Then, I want to generate the stub file for this module. I have tested the pybind11-stubgen, and it works:
image

However, it failed when generate stub file for my-self package:
image

How should I use the pybind11-stubgen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions