simstring icon indicating copy to clipboard operation
simstring copied to clipboard

Allow to install from pip

Open thotypous opened this issue 5 years ago • 2 comments

Currently, it is impossible to install simstring Python bindings directly from pip (e.g. via a pip-requirements.txt file in a project). It is currently necessary to manually clone the repository, run configure, enter the Python bindings directory, run prepare.sh, to finally be able to run setup.py or pip.

This patches fixes this issue by:

  • Renaming setup.py.in to setup.py, removing thus the need to previously run configure. The package name is now static and the version is obtained by reading the configure.in file.
  • Modifying setup.py so that it calls prepare.sh automatically as a pre-hook.

Besides that, this patch also:

  • Improves prepare.sh error reporting, so that the user gets a meaningful error message if swig is missing from the system.
  • Removes -liconv -lpython from extra_link_args. It is not necessary anymore to explicitly include these libraries (you can just assume they are loaded) - tested in Ubuntu LTS and Arch Linux. By removing them, simstring can be built for PyPy.

After this patch is merged, one will be able to install using pip by including the following line in their pip-requirements.txt file:

-e git+https://github.com/chokkan/simstring.git#egg=simstring&subdirectory=swig/python 

(you can test with my fork if you want to test before merging)

thotypous avatar Apr 18 '20 12:04 thotypous

+1 for this PR!

fginter avatar Dec 01 '20 15:12 fginter

Any progress on this?

PyDataBlog avatar Jan 02 '22 00:01 PyDataBlog