问题
I want to make my python code pip-able. However, my code depends on another library which isn't pip-able. So, somehow I need to compile the source code when a user calls pip install
.
How can I do that? I haven't been able to find a good reference via simple Google searches.
回答1:
I would recommend taking a look at how llvmlite solves this problem. The idea is to use custom cmdclass
s in setup.py
that calls your other build system. In llvmlite, they call out to CMake, for example.
See: https://github.com/numba/llvmlite/blob/master/setup.py
来源:https://stackoverflow.com/questions/30657841/how-to-compile-c-dependencies-during-pip-install