cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.54k stars 1.64k forks source link

Add setup.py and release script for pypi #145

Open akbargumbira opened 5 years ago

akbargumbira commented 5 years ago

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:

/.
/usr
/usr/share
/usr/share/pyshared
/usr/share/pyshared/svmutil.py
/usr/share/pyshared/svm.py
/usr/share/doc
/usr/share/doc/python-libsvm
/usr/share/doc/python-libsvm/copyright
/usr/share/doc/python-libsvm/README.gz
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/share/doc/python-libsvm/changelog.Debian.gz
/usr/lib/python2.7/dist-packages/svmutil.py
/usr/lib/python2.7/dist-packages/svm.py

Though you can manually link libsvm binding to your active python environment simply by appending to sys as such:

>>> import sys
>>> sys.path.append('/usr/share/pyshared')

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

akbargumbira commented 5 years ago

In case it is too much hassle for you to provide the binding on pypi, I am happy to keep my fork up to date with the upstream and release the package on pypi..