Some context: I have some C code that when compiled I can call in the terminal like this: ./my_excec -params
It generates some files that I am using in python t
I was able to find a really easy solution.
As I said my main problem was that I was packaging the compiled files. To exclude those files form the tarball/zip just had to put this on MANIFEST.in: prune bin
.
Then just need to call the makefile from setup.py:
directory = 'bin'
if not os.path.exists(directory):
os.makedirs(directory)
subprocess.call(['make', '-C', 'src'])
With that when someone does pip install whatever
is going to call the make file and put the binaries on bin
(have to specify this on the make file).
Then just need to say the setup to copy those files:
setup(
...
data_files=[('bin', ['bin/binaries'])],
)
Done! Hopefuly someone find this usefull :)