-
-
Notifications
You must be signed in to change notification settings - Fork 3k
stubgen and C Extensions (pyd) #7692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
OK so I did what I mentioned above. I placed the new extension file into sys.modules.. then passed the module name using --module. and now I am getting this traceback
|
It looks like you hit a bug though -- it shouldn't crash. |
Is the project open source? Can you provide detailed instructions for reproducing the crash? |
https://github.com/kdschlosser/python-openzwave/tree/mypy-test The build process is pretty involved.. don't run this on a raspberry pi or it will take over an hour to compile.... this is the command to run when building it. This installs nothing into the site-packages folder of the interpreter you use.
if you are running on a fairly new machine it should take 2-3 minutes for it to complete. The build system works for the OS's listed below. here is the list of requirements that the build system does not handle.
From the last error it appears as tho it is finding the module properly. I didn't look at the code to see how the loading of the module is done. |
The later error: |
Thanks for the instructions! Here's an easy way to reproduce the crash:
|
I also get a similar error with the Moving the:
files temporarily out of |
Ì get the same error with package
Installing the interpreted version of mypy instead gives this error:
|
Uh oh!
There was an error while loading. Please reload this page.
I work on a project called python-openzwave. I have rewritten the build system for this library. The library makes use of a CPP library called OpenZWave. This library gets compiled by the build system. Cython is what is used for the "bridge" between python code and the cpp code in OpenZWave. The output of this process is a single pyd file. I would like to be able to create a stub file for this pyd file. I have encountered an issue when creating documentation for the library where if the library is already installed on the system and the build system imports the newly created pyd file python crashes. So a direct import of the new file cannot be done. Using the code example below I am able to import the new library and avoid the application crash.
I am unsure of how stubgen handles the importation of c extensions. I am needing to build the stub file at build time so I have subclassed setuptools.Command to acomplish this task,
the code below is what is used in the
run
method of the classwhen this runs the program exits with the following error
using the positional file is the only way to be able to direct the program to load the proper pyd file. Is there a special way to go about passing the path and filename of the c extension that I want to create the stub file for? or do I have to use the imp module as outlines in the code block above and set the module into sys.modules and then pass the module name to stubgen?
The text was updated successfully, but these errors were encountered: