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.
Pip is able to install packages configured with their dependencies, because most authors package their code as wheels by default before submitting to PyPI.
The pip install <package> command always looks for the latest version of the package and installs it. It also searches for dependencies listed in the package metadata and installs them to ensure that the package has all the requirements that it needs.
Instead, package dependencies can be seen using one of the following commands in Python: pip show: List dependencies of Python packages that have already been installed. pipdeptree: List the dependencies in a tree form. Pip list: List installed packages with various conditions.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With