Index ¦ Archives  ¦ Atom  ¦ RSS > Tag: distutils ¦ RSS

Building a binary into your Python package

Mon 15 December 2014

Firstly, let me acknowledge this is a rare problem. So the lack of documentation I ran into is totally acceptable. The problem: I have a Python package that has a C++ component that isn't an extension, it's a binary. I wanted that binary to be on the PATH of users, but it's not a Python entry point, so the usual way failed while attempting to read the file as text.

So I did some hacking, and after a lot of attempts, I whittled the result back down to something that's actually quite reasonable. If I had ever seen a documentation page or blog post mentioning this is how you do it, I would have been able to just follow along and I would have been happy with the result. Sadly, there was none, so I'm writing it:

Continue reading →

© Fahrzin Hemmati. Built using Pelican. Theme by Giulio Fidente on github.