Closed nyckmaia closed 1 year ago
I don't use Windows, VSCode, or WSL, so I can't answer the questions on those topics.
pybind11-stubgen does not recognize the type 'json'
Now pybind11-stubgen
tries to resolve the names used in the output *.pyi
files to add necessary import statements. Most likely your module uses a json object as argument/return value, but never defines what json
is. If you run mypy
on generated stubs it should provide a similar error.
It would be more helpful if you frame the questions in a smaller context with a minimal reproducible example.
Hi, I have a C++/Pybind11 project in which I'am using
pybind11-stubgen
locally and also in Github actions to generate my Python stubs.Topic 01: v0.16.2 + Old Syntax
I was using the
pybind11-stubgen
versionv0.16.2
and everthing was working good!In my Python script to generate the stubs, I was using this line below:
v0.16.2
generates all stubs on Windows, Linux and OSX without any errors.Question 1: Why I don't get the VS Code autocomple (stubs) inside the WSL (Linux) environment?
Topic 02: v1.1.0 + New Syntax
Well, after that, today I tried to use the lasted versio of
pybind11-stubgen
. Thev1.1.0
. To do so, I have to change the line above to remove deprecated arguments. The new line (new syntax) is below:v0.16.2
generates all stubs on Windows, Linux and OSX without any errors.Question 2: Why I don't get the VS Code autocomple (stubs) in any operational system Python enviroment?
Topic 03: [ERROR 'json']
Using the
v1.1.0
, if I remove the--ignore-all-errors
I got a single line output saying thatpybind11-stubgen
does not recognize the type 'json'. Yes, I'am using thenlohmann::json
(link here) as input argument of many functions of my module. It was working good onv0.16.2
.Question 3: What is the problem with json?
Systems:
Could you help me?
Thank you,