Sam
Sam

Reputation: 3485

How to generate a 'stub' Python interface for a 3p library for development?

I'm developing for RPi. I'd like to do the majority of my coding on a fast, local machine with a snappy IDE. To do this, I need to be able to pip install the same modules as I have on the RPi. Problem is, one of the most popular, RPi.GPIO is only installable on the RPi for obvious reasons (my laptop doesn't have GPIO pins!)

As the library is primarily written in C, it's not easy to extract a Python interface from it. Is there any tool that can scan the C/compiled module and extract the Python interface, stubbed, and output that somewhere I can then easily import it?

I'd like to contribute back to the project and have a stubbed Python interface, that is installable on non-rpis so that development is easy.

Having never released a Python library before, some bonus points for pointers to how to 'teach' pip to download different packages on different OSs.

Here's a ticket of the issue I'd like to resolve.

Upvotes: 0

Views: 103

Answers (0)

Related Questions