Skip to content

Failed to generate stub file for my package #237

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?

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions