Python setup.py call makefile don't include binaries

。_饼干妹妹 提交于 2019-12-01 05:57:24

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 :)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!