ztane / python-Levenshtein

The Levenshtein Python C extension module contains functions for fast computation of Levenshtein distance and string similarity
GNU General Public License v2.0
1.26k stars 155 forks source link

setup.py build/install copies also .c and .h files #20

Open sandrotosi opened 9 years ago

sandrotosi commented 9 years ago

Hi, with the move of _levenshtein.{c,h} to Levenshtein there is a side effect of copying those files during build/install setup.py install/build command:

$ python setup.py build
...
$ tree build/lib.linux-x86_64-2.7/Levenshtein/
build/lib.linux-x86_64-2.7/Levenshtein/
├── __init__.py
├── _levenshtein.c
├── _levenshtein.h
├── _levenshtein.so
└── StringMatcher.py

0 directories, 5 files

which they dont need to be there (and generates a small inconvenience in the Debian packaging, as the location conflicts between normal and debug packages).

Regards, Sandro

ztane commented 9 years ago

I am not sure which one is the preferred way (on my virtualenvs I can see .c files for other packages, for example markupsafe and zope.interface)

sandrotosi commented 9 years ago

The preferred way is to not install source code files in the module dir, as they cannot be used in the python interpreter (but only the compiled extension is)