From 22f85c94158eba44cfcc2609c80bf662868c0673 Mon Sep 17 00:00:00 2001 From: Yomguithereal Date: Thu, 23 Aug 2018 15:41:34 +0200 Subject: [PATCH] Fixing setup to install without cython --- MANIFEST.in | 2 ++ Makefile | 6 ++++-- setup.py | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..fbaac95 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include README.md +recursive-include fog *.c *.pyx diff --git a/Makefile b/Makefile index b772ffd..4ea8902 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,12 @@ test: build-ext unit publish: lint test upload clean build-ext: - python setup.py build_ext --inplace + find . -name *.pyx | xargs cython clean: - rm -rf *.egg-info .pytest_cache .ipynb_checkpoints ./**/__pycache__ ./**/**/__pycache__ build dist + rm -rf *.egg-info .pytest_cache .ipynb_checkpoints build dist + find . -name __pycache__ -type d | xargs rm -rf + find . -name *.c -type f | xargs rm lint: @echo Linting source code using pep8... diff --git a/setup.py b/setup.py index 0474e7f..130aac9 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,17 @@ -from setuptools import setup, find_packages -from Cython.Build import cythonize +from setuptools import setup, find_packages, Extension with open('./README.md', 'r') as f: long_description = f.read() +EXTENSIONS = [ + Extension( + 'fog.metrics.levenshtein', + ['fog/metrics/levenshtein.c'] + ) +] + setup(name='fog', - version='0.5.3', + version='0.5.4', description='A fuzzy matching & clustering library for python.', long_description=long_description, long_description_content_type='text/markdown', @@ -16,18 +22,12 @@ setup(name='fog', keywords='fuzzy', python_requires='>=3', packages=find_packages(exclude=['experiments', 'test']), - ext_modules=cythonize('fog/metrics/*.pyx'), - package_data={'': ['*.pyx'], 'docs': ['README.md']}, + ext_modules=EXTENSIONS, install_requires=[ - 'cython', 'dill==0.2.7.1', 'phylactery==0.1.1', 'Unidecode==1.0.22' ], - setup_requires=[ - 'cython', - 'setuptools>=18.0' - ], entry_points={ 'console_scripts': ['fog=fog.cli.__main__:main'] },