Add setup.py and release script for pypi #145
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @cjlin1, this PR is to add setup.py and release script for python bindings so that we can get them easily from pypi. The motivation behind this is:
/var/lib/dpkg/info/python-libsvm.list
is this:Though you can manually link libsvm binding to your active python environment simply by appending to sys as such:
Package to fix similar problem is out there (e.g https://github.com/Salinger/libsvm-python), but would be nice that this binding is rather streamlined with this project and always updated to the current version. Had an issue over here (Not able to run code bukalapak/pybrisque#4) because the binding version isn't compatible with the shared library (apparently it's fine using libsvm 3.21 distributed on Ubuntu 18.04 with python binding 3.14 on that particular project). If the binding is available on pypi for every version, we can easily match it with the shared library from distribution.
Having this binding on pypi would fix another problem on some situation: e.g in pybrisque (https://github.com/bukalapak/pybrisque/blob/master/setup.py), we want libsvm's python binding to be installed right away when user installs pybrisque, but since it's not on pypi, we had to do it using dependency-links. But since process-dependency-links is obsolete in pip >= 19, we couldn't do this anymore. Of course we can alway ask users to install the binding separately, but the former is just easier to the user.
I've put a test package from this PR here https://test.pypi.org/project/libsvm/, you can try to install with this command:
pip install -i https://test.pypi.org/simple/ libsvm
Thank you. Cheers